From b9c0e1dfa3c27c76e4a1e9934ba2c536bd33eb02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 29 Nov 2013 01:59:26 +0100 Subject: [PATCH] Prevent segfault when unknown option is given. --- idm.cpp | 1 + scan.cpp | 1 + 2 files changed, 2 insertions(+) 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"; -- 1.8.2.3