shithub: sox

Download patch

ref: 9cf62a52de4d834160378bb6b8f4cfe9237110bc
parent: 6887a7c79ade167e0681d078c90edb25a4bb9d4f
author: robs <robs>
date: Sat Apr 21 15:50:11 EDT 2007

fix verbosity logic

--- a/src/sox.c
+++ b/src/sox.c
@@ -874,12 +874,14 @@
     case 'V':
       if (optarg == NULL)
         ++sox_output_verbosity_level;
-      else if (sscanf(optarg, "%i %c", &i, &dummy) != 1 || i < 0) {
-        sox_output_verbosity_level = 2;
-        sox_fail("Verbosity value `%s' is not a non-negative integer", optarg);
-        exit(1);
+      else {
+        if (sscanf(optarg, "%i %c", &i, &dummy) != 1 || i < 0) {
+          sox_output_verbosity_level = 2;
+          sox_fail("Verbosity value `%s' is not a non-negative integer", optarg);
+          exit(1);
+        }
+        sox_output_verbosity_level = (unsigned)i;
       }
-      sox_output_verbosity_level = (unsigned)i;
       break;
     }
   }