prune-trace: check 2nd cmd.parse() return value
As the first cmd.parse() call was already checked before, parsing a second time should never fail. Nevertheless, we can look at the return value without much effort. Found by Coverity Scan, CID 25494. Change-Id: Id012cf7183fe7b2022d33e6cbcb19ba49b544c99
This commit is contained in:
@ -102,7 +102,10 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
// Since the pruner might have added command line options, we need to
|
||||
// reparse all arguments.
|
||||
cmd.parse();
|
||||
if (!cmd.parse()) {
|
||||
std::cerr << "Error parsing arguments." << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (cmd[HELP] || cmd[UNKNOWN] || cmd.parser()->nonOptionsCount() > 0) {
|
||||
for (option::Option* opt = cmd[UNKNOWN]; opt; opt = opt->next()) {
|
||||
|
||||
Reference in New Issue
Block a user