]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplaymidi: Allow to pass 0 to -u option, too
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 15:22:20 +0000 (17:22 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 17:46:32 +0000 (19:46 +0200)
Specifying -u 0 shouldn't be treated as an error but it should mean
the legacy MIDI 1.0 handling.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
seq/aplaymidi/aplaymidi.c

index dd8d07997985d97dc5112f778b898481c5af02c5..7aeea824ce0d72765f5e69bcc2ce6679817a354d 100644 (file)
@@ -996,11 +996,9 @@ int main(int argc, char *argv[])
                        end_delay = atoi(optarg);
                        break;
                case 'u':
-                       if (strcmp(optarg, "1")) {
-                               errormsg("Only MIDI 1.0 is supported");
-                               return 1;
-                       }
-                       ump_mode = 1;
+                       ump_mode = atoi(optarg);
+                       if (ump_mode < 0 || ump_mode > 1)
+                               fatal("Only MIDI 1.0 is supported");
                        break;
                default:
                        usage(argv[0]);