Skip to content

Commit

Permalink
qoptions: crash if command line value not given at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Nov 3, 2014
1 parent 21ec216 commit 62199e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/common/qoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ bool QOptions::parse(int argc, const char *const*argv)
//qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
} else {
it = args.erase(it);
if (it == args.end())
break;
it_list->setValue(*it);
//qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
}
Expand Down Expand Up @@ -248,6 +250,8 @@ bool QOptions::parse(int argc, const char *const*argv)
}
if (it->length() == sname_len+1) {//-o abco
it = args.erase(it);
if (it == args.end())
break;
it_list->setValue(*it);
//qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
} else {
Expand Down

0 comments on commit 62199e6

Please sign in to comment.