[tools] mcd_pcm.c: Differentiate between "no input filename" and "too many parameters".
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 01:36:33 +0000 (21:36 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 01:36:33 +0000 (21:36 -0400)
src/tools/mcd_pcm.c

index 66fc8f0..493322e 100644 (file)
@@ -431,13 +431,18 @@ int main(int argc, char *argv[])
 
        // Get the input filename.
        pcm_filename = poptGetArg(optCon);
-       if (pcm_filename == NULL || poptPeekArg(optCon) != NULL) {
-               // Either the input filename wasn't specified,
-               // or too many filenames were specified.
+       if (pcm_filename == NULL) {
+               // No input filename specified.
                fprintf(stderr, "%s: no filename specified\n"
                        "Try `%s --help` for more information.\n",
                        argv[0], argv[0]);
                return EXIT_FAILURE;
+       } else if (poptPeekArg(optCon) != NULL) {
+               // Too many parameters specified.
+               fprintf(stderr, "%s: too many parameters specified\n"
+                       "Try `%s --help` for more information.\n",
+                       argv[0], argv[0]);
+               return EXIT_FAILURE;
        }
 
        // Done parsing arguments.