openbsd-ports/devel/cmake/patches/patch-Source_cmake_cxx
espie 9d34b21437 cmake, a `new' build system. Used by KDE4.
Easier to work with than autoconf/automake/libtool.
2006-07-20 09:23:13 +00:00

49 lines
2.2 KiB
Plaintext

$OpenBSD: patch-Source_cmake_cxx,v 1.1.1.1 2006/07/20 09:23:13 espie Exp $
--- Source/cmake.cxx.orig Sun Jul 2 19:01:35 2006
+++ Source/cmake.cxx Sun Jul 2 19:02:30 2006
@@ -1279,7 +1279,7 @@ int cmake::Configure()
if(!this->CacheManager->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
{
char ver[256];
- sprintf(ver,"%i.%i",cmMakefile::GetMajorVersion(),
+ snprintf(ver, sizeof ver, "%i.%i",cmMakefile::GetMajorVersion(),
cmMakefile::GetMinorVersion());
this->CacheManager->AddCacheEntry
("CMAKE_BACKWARDS_COMPATIBILITY",ver,
@@ -1645,7 +1645,7 @@ int cmake::DumpDocumentationToFile(std::
const char *terse;
const char *full;
char tmp[1024];
- sprintf(tmp,"Version %d.%d (%s)", cmake::GetMajorVersion(),
+ snprintf(tmp, sizeof tmp, "Version %d.%d (%s)", cmake::GetMajorVersion(),
cmake::GetMinorVersion(), cmVersion::GetReleaseVersion().c_str());
f << "<html>\n";
f << "<h1>Documentation for commands of CMake " << tmp << "</h1>\n";
@@ -1752,7 +1752,7 @@ int cmake::LoadCache()
if(!this->CacheManager->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
{
char ver[256];
- sprintf(ver,"%i.%i",cmMakefile::GetMajorVersion(),
+ snprintf(ver, sizeof ver, "%i.%i",cmMakefile::GetMajorVersion(),
cmMakefile::GetMinorVersion());
this->CacheManager->AddCacheEntry
("CMAKE_BACKWARDS_COMPATIBILITY",ver,
@@ -2209,7 +2209,7 @@ void cmake::GenerateGraphViz(const char*
continue;
}
//std::cout << "Found target: " << tit->first.c_str() << std::endl;
- sprintf(tgtName, "%s%d", graphNodePrefix, cnt++);
+ snprintf(tgtName, sizeof tgtName, "%s%d", graphNodePrefix, cnt++);
targetNamesNodes[realTargetName] = tgtName;
targetPtrs[realTargetName] = &tit->second;
}
@@ -2246,7 +2246,7 @@ void cmake::GenerateGraphViz(const char*
}
if ( tarIt == targetNamesNodes.end() )
{
- sprintf(tgtName, "%s%d", graphNodePrefix, cnt++);
+ snprintf(tgtName, sizeof tgtName, "%s%d", graphNodePrefix, cnt++);
targetDeps[libName] = 2;
targetNamesNodes[libName] = tgtName;
//str << " \"" << tgtName << "\" [ label=\"" << libName