openbsd-ports/devel/cmake/patches/patch-Source_cmCommandArgumentParserHelper_cxx
2007-08-25 08:35:20 +00:00

44 lines
1.7 KiB
Plaintext

$OpenBSD: patch-Source_cmCommandArgumentParserHelper_cxx,v 1.4 2007/08/25 08:35:20 espie Exp $
--- Source/cmCommandArgumentParserHelper.cxx.orig Mon Jul 16 23:12:30 2007
+++ Source/cmCommandArgumentParserHelper.cxx Sun Aug 12 16:02:01 2007
@@ -29,12 +29,12 @@ cmCommandArgumentParserHelper::cmCommandArgumentParser
this->FileName = 0;
this->RemoveEmpty = true;
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;
}
@@ -160,8 +159,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;
}