$OpenBSD: patch-Source_cmCommandArgumentParserHelper_cxx,v 1.3 2007/03/20 11:23:10 espie Exp $
--- Source/cmCommandArgumentParserHelper.cxx.orig	Wed Jan 10 18:59:12 2007
+++ Source/cmCommandArgumentParserHelper.cxx	Sun Mar 18 13:52:02 2007
@@ -29,12 +29,12 @@ cmCommandArgumentParserHelper::cmCommandArgumentParser
   this->FileName = 0;
 
   this->EmptyVariable[0] = 0;
-  strcpy(this->DCURLYVariable, "${");
-  strcpy(this->RCURLYVariable, "}");
-  strcpy(this->ATVariable,     "@");
-  strcpy(this->DOLLARVariable, "$");
-  strcpy(this->LCURLYVariable, "{");
-  strcpy(this->BSLASHVariable, "\\");
+  strlcpy(this->DCURLYVariable, "${", sizeof(this->DCURLYVariable));
+  strlcpy(this->RCURLYVariable, "}", sizeof(this->RCURLYVariable));
+  strlcpy(this->ATVariable,     "@", sizeof(this->ATVariable));
+  strlcpy(this->DOLLARVariable, "$", sizeof(this->DOLLARVariable));
+  strlcpy(this->LCURLYVariable, "{", sizeof(this->LCURLYVariable));
+  strlcpy(this->BSLASHVariable, "\\", sizeof(this->BSLASHVariable));
 
   this->NoEscapeMode = false;
   this->ReplaceAtSyntax = false;
@@ -58,8 +58,7 @@ char* cmCommandArgumentParserHelper::AddString(const c
     {
     return this->EmptyVariable;
     }
-  char* stVal = new char[strlen(str)+1];
-  strcpy(stVal, str);
+  char *stVal = cmSystemTools::dupstring(str);
   this->Variables.push_back(stVal);
   return stVal;
 }
@@ -143,8 +142,8 @@ char* cmCommandArgumentParserHelper::CombineUnions(cha
     }
   size_t len = strlen(in1) + strlen(in2) + 1;
   char* out = new char [ len ];
-  strcpy(out, in1);
-  strcat(out, in2);
+  strlcpy(out, in1, len);
+  strlcat(out, in2, len);
   this->Variables.push_back(out);
   return out;
 }
