From 7760ef3a345035d7bef2519c7a768610d6b93155 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 17 May 2018 16:10:42 +0200 Subject: [PATCH] Simulator: fix argument parsing. When getopt_long sets *flag to val, it returns 0. Previously this was considered an error. See getopt(3). --- simulator/simulator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simulator/simulator.c b/simulator/simulator.c index 7938662..1f735b8 100644 --- a/simulator/simulator.c +++ b/simulator/simulator.c @@ -96,6 +96,9 @@ void sim_start(int argc, char** argv) { while ((c = getopt_long (argc, argv, shortopts, opts, &index)) != -1) switch (c) { + case 0: + // Long option without short counterpart. + break; case 'q': verbose = 0; break;