correct usage of tokenizer, memory bug, Fixes #3525

[SVN r57808]
This commit is contained in:
Sascha Ochsenknecht
2009-11-20 10:03:08 +00:00
parent 8add1551dc
commit 98b0f14f5a

View File

@@ -70,7 +70,8 @@ int main(int ac, char* av[])
ss << ifs.rdbuf();
// Split the file content
char_separator<char> sep(" \n\r");
tokenizer<char_separator<char> > tok(ss.str(), sep);
string sstr = ss.str();
tokenizer<char_separator<char> > tok(sstr, sep);
vector<string> args;
copy(tok.begin(), tok.end(), back_inserter(args));
// Parse the file and store the options
@@ -87,7 +88,7 @@ int main(int ac, char* av[])
cout << "Magic value: " << vm["magic"].as<int>() << "\n";
}
}
catch(exception& e) {
catch (std::exception& e) {
cout << e.what() << "\n";
}
}