summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-10-06 18:55:48 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-10-06 18:55:48 (GMT)
commit80533948b287cd26ec27cdfc29e76aad1ad38186 (patch)
tree32cb1fb2723d086a17bf21682b664688f6ee862c /Source
parent5b74d031dba196989bdcc2dd13d0a857d476cea1 (diff)
downloadCMake-80533948b287cd26ec27cdfc29e76aad1ad38186.zip
CMake-80533948b287cd26ec27cdfc29e76aad1ad38186.tar.gz
CMake-80533948b287cd26ec27cdfc29e76aad1ad38186.tar.bz2
Fix bus error on mac. Was a result of not having null termination of arg list to sw_vers calls.
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemInformation.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 0a02c4c..f3150ea 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3007,13 +3007,13 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha
if(buffer[i] == ' ' || buffer[i] == '\t')
{
break;
- }
+ }
if(buffer[i] != '\n' && buffer[i] != '\r')
{
kwsys_stl::string val = value;
value = buffer[i];
value += val;
- }
+ }
}
return value;
}
@@ -3385,19 +3385,24 @@ void SystemInformationImplementation::CallSwVers()
kwsys_stl::string output;
kwsys_stl::vector<const char*> args;
args.clear();
- args.push_back("sw_vers");
+ args.push_back("sw_vers");
args.push_back("-productName");
+ args.push_back(0);
output = this->RunProcess(args);
this->OSName = output;
- args.pop_back();
+ args.clear();
+ args.push_back("sw_vers");
args.push_back("-productVersion");
+ args.push_back(0);
output = this->RunProcess(args);
this->OSRelease = output;
- args.pop_back();
+ args.clear();
+ args.push_back("sw_vers");
args.push_back("-buildVersion");
+ args.push_back(0);
output = this->RunProcess(args);
this->OSVersion = output;
#endif