diff --git a/src/CommandLine.cc b/src/CommandLine.cc index 0f7b24d..c2b28a2 100644 --- a/src/CommandLine.cc +++ b/src/CommandLine.cc @@ -28,7 +28,7 @@ using namespace std; /// strict weak ordering by flag (lexicographic). bool Option::operator<(const _Option &b) const { - return std::strcmp(flag, b.flag) < 0; + return (flag && b.flag) ? std::strcmp(flag, b.flag) < 0 : (flag < b.flag); } ostream &operator<<(ostream &a, const Option &b) { @@ -50,8 +50,12 @@ ostream &operator<<(ostream &a, const Option &b) { CommandLine::CommandLine(const set