summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-01-08 14:59:24 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-01-08 14:59:24 (GMT)
commitc336a9b1ac995fdc6f12815416425c2c44d4f2e8 (patch)
tree4f9a076d34b562cf8b39c3584529e2b0a8baa65c /Source/cmake.cxx
parent4f4984ff7fb4fb2800937edf577844cda86d3a6a (diff)
downloadCMake-c336a9b1ac995fdc6f12815416425c2c44d4f2e8.zip
CMake-c336a9b1ac995fdc6f12815416425c2c44d4f2e8.tar.gz
CMake-c336a9b1ac995fdc6f12815416425c2c44d4f2e8.tar.bz2
BUG: make sure null terminator is in the right place for putenv static char array
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 92ff2d7..8416fe2 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -877,7 +877,7 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
size = 4999;
}
strncpy(envCC, env.c_str(), size);
- envCC[4999] = 0;
+ envCC[size] = 0;
putenv(envCC);
// Restore CXX
@@ -893,7 +893,7 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
size = 4999;
}
strncpy(envCXX, env.c_str(), size);
- envCXX[4999] = 0;
+ envCXX[size] = 0;
putenv(envCXX);
}