Changed the command line argument's requirements

This commit is contained in:
Kayne Ruse
2014-10-01 02:49:25 +10:00
parent be9ce33637
commit 1f099a07dc
+3 -3
View File
@@ -53,15 +53,15 @@ void ConfigUtility::Load(std::string fname, int argc, char* argv[]) {
} }
//set some specific values //set some specific values
if (!strncmp(argv[i], "-C", 2)) { if (!strncmp(argv[i], "-", 1)) {
//wipe the variables //wipe the variables
memset(key, 0, 256); memset(key, 0, 256);
memset(key, 0, 256); memset(key, 0, 256);
//read the key-value pair //read the key-value pair
if (sscanf(argv[i], "-C%[^=]=%[^\0]", key, val) != 2) { if (sscanf(argv[i], "-%[^=]=%[^\0]", key, val) != 2) {
std::ostringstream os; std::ostringstream os;
os << "Failed to read a command line config argument (expected -C%s=%s):" << std::endl; os << "Failed to read a command line config argument (expected -%s=%s):" << std::endl;
os << "\targv[" << i << "]: " << argv[i] << std::endl; os << "\targv[" << i << "]: " << argv[i] << std::endl;
os << "\tkey: " << key << std::endl; os << "\tkey: " << key << std::endl;
os << "\tval: " << val << std::endl; os << "\tval: " << val << std::endl;