openbsd-ports/devel/cmake/patches/patch-Source_cmCPluginAPI_cxx
espie 8063f8ee22 find qmake4, not qmake...
regen other patches with new diff.
2007-03-20 11:23:10 +00:00

52 lines
1.7 KiB
Plaintext

$OpenBSD: patch-Source_cmCPluginAPI_cxx,v 1.3 2007/03/20 11:23:10 espie Exp $
--- Source/cmCPluginAPI.cxx.orig Wed Jan 10 18:59:12 2007
+++ Source/cmCPluginAPI.cxx Sun Mar 18 13:52:02 2007
@@ -405,10 +405,11 @@ char CCONV *cmExpandVariablesInString(void *arg, const
mf->ExpandVariablesInString(barf,
(escapeQuotes ? true : false),
(atOnly ? true : false));
- char *res = static_cast<char *>(malloc(result.size() + 1));
+ size_t sz = result.size() + 1;
+ char *res = static_cast<char *>(malloc(sz));
if (result.size())
{
- strcpy(res,result.c_str());
+ strlcpy(res,result.c_str(), sz);
}
res[result.size()] = '\0';
return res;
@@ -581,24 +582,27 @@ void CCONV cmSourceFileSetName2(void *arg, const char*
char * CCONV cmGetFilenameWithoutExtension(const char *name)
{
std::string sres = cmSystemTools::GetFilenameWithoutExtension(name);
- char *result = (char *)malloc(sres.size()+1);
- strcpy(result,sres.c_str());
+ size_t sz = sres.size() + 1;
+ char *result = (char *)malloc(sz);
+ strlcpy(result,sres.c_str(), sz);
return result;
}
char * CCONV cmGetFilenamePath(const char *name)
{
std::string sres = cmSystemTools::GetFilenamePath(name);
- char *result = (char *)malloc(sres.size()+1);
- strcpy(result,sres.c_str());
+ size_t sz = sres.size() + 1;
+ char *result = (char *)malloc(sz);
+ strlcpy(result,sres.c_str(), sz);
return result;
}
char * CCONV cmCapitalized(const char *name)
{
std::string sres = cmSystemTools::Capitalized(name);
- char *result = (char *)malloc(sres.size()+1);
- strcpy(result,sres.c_str());
+ size_t sz = sres.size() + 1;
+ char *result = (char *)malloc(sz);
+ strlcpy(result,sres.c_str(), sz);
return result;
}