import-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 25509. Change-Id: I58466f5d123da2b541a6a88b72bafa1f754a581e
This commit is contained in:
@ -175,7 +175,10 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
// Since the importer might have added command line options, we need to
|
// Since the importer might have added command line options, we need to
|
||||||
// reparse all arguments.
|
// 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) {
|
if (cmd[HELP] || cmd[UNKNOWN] || cmd.parser()->nonOptionsCount() > 0) {
|
||||||
for (option::Option* opt = cmd[UNKNOWN]; opt; opt = opt->next()) {
|
for (option::Option* opt = cmd[UNKNOWN]; opt; opt = opt->next()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user