openbsd-ports/devel/cmake/patches/patch-Source_cmCommandArgumentParserHelper_cxx
espie 58e493f790 update to cmake 2.4.5, quite a few patches vanish since cmake can now
build stuff with system libraries, so we no longer have to repair
curl/zlib... just xmlrpc which cmake can't find without help.
2006-12-18 16:04:31 +00:00

44 lines
1.6 KiB
Plaintext

$OpenBSD: patch-Source_cmCommandArgumentParserHelper_cxx,v 1.2 2006/12/18 16:04:31 espie Exp $
--- Source/cmCommandArgumentParserHelper.cxx.orig Mon Dec 4 17:03:54 2006
+++ Source/cmCommandArgumentParserHelper.cxx Sun Dec 17 11:07:03 2006
@@ -29,12 +29,12 @@ cmCommandArgumentParserHelper::cmCommand
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::Add
{
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::Com
}
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;
}