Commit 94040305 authored by Zach's avatar Zach
Browse files

Fix bus error on mac. Was a result of not having null termination of arg list to sw_vers calls.

parent 86167fec
...@@ -3007,13 +3007,13 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha ...@@ -3007,13 +3007,13 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha
if(buffer[i] == ' ' || buffer[i] == '\t') if(buffer[i] == ' ' || buffer[i] == '\t')
{ {
break; break;
} }
if(buffer[i] != '\n' && buffer[i] != '\r') if(buffer[i] != '\n' && buffer[i] != '\r')
{ {
kwsys_stl::string val = value; kwsys_stl::string val = value;
value = buffer[i]; value = buffer[i];
value += val; value += val;
} }
} }
return value; return value;
} }
...@@ -3385,19 +3385,24 @@ void SystemInformationImplementation::CallSwVers() ...@@ -3385,19 +3385,24 @@ void SystemInformationImplementation::CallSwVers()
kwsys_stl::string output; kwsys_stl::string output;
kwsys_stl::vector<const char*> args; kwsys_stl::vector<const char*> args;
args.clear(); args.clear();
args.push_back("sw_vers");
args.push_back("sw_vers");
args.push_back("-productName"); args.push_back("-productName");
args.push_back(0);
output = this->RunProcess(args); output = this->RunProcess(args);
this->OSName = output; this->OSName = output;
args.pop_back(); args.clear();
args.push_back("sw_vers");
args.push_back("-productVersion"); args.push_back("-productVersion");
args.push_back(0);
output = this->RunProcess(args); output = this->RunProcess(args);
this->OSRelease = output; this->OSRelease = output;
args.pop_back(); args.clear();
args.push_back("sw_vers");
args.push_back("-buildVersion"); args.push_back("-buildVersion");
args.push_back(0);
output = this->RunProcess(args); output = this->RunProcess(args);
this->OSVersion = output; this->OSVersion = output;
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment