From: František Dvořák Date: Fri, 29 Nov 2013 00:59:26 +0000 (+0100) Subject: Prevent segfault when unknown option is given. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=b9c0e1dfa3c27c76e4a1e9934ba2c536bd33eb02;p=dmlite-clients.git Prevent segfault when unknown option is given. --- diff --git a/idm.cpp b/idm.cpp index 9fa4495..0c425a4 100644 --- a/idm.cpp +++ b/idm.cpp @@ -11,6 +11,7 @@ struct option longopts[] = { { "config", required_argument, NULL, 'c' }, { "help", no_argument, NULL, 'h' }, + { NULL, no_argument, NULL, 0 }, }; const char *optstring = "hc:u:"; diff --git a/scan.cpp b/scan.cpp index 2ef9076..a1ca7ee 100644 --- a/scan.cpp +++ b/scan.cpp @@ -21,6 +21,7 @@ struct option longopts[] = { { "config", required_argument, NULL, 'c' }, { "help", no_argument, NULL, 'h' }, + { NULL, no_argument, NULL, 0}, }; const char *optstring = "c:h";