examples/parse_args.h: avoid unreachable code, add comment
authorPaul Brossier <piem@piem.org>
Fri, 5 Oct 2018 19:04:12 +0000 (21:04 +0200)
committerPaul Brossier <piem@piem.org>
Fri, 5 Oct 2018 19:04:12 +0000 (21:04 +0200)
examples/parse_args.h

index 4402eff..abe1023 100644 (file)
@@ -200,11 +200,11 @@ parse_args (int argc, char **argv)
     {NULL,                    0, NULL, 0}
   };
 #endif /* HAVE_GETOPT_H */
-  prog_name = argv[0];
+  // better safe than sorry
   if (argc < 1) {
     usage (stderr, 1);
-    return -1;
   }
+  prog_name = argv[0];
 #ifdef HAVE_GETOPT_H
   do {
     next_option = getopt_long (argc, argv, options, long_options, NULL);