aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/tinymix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/tinymix.c b/utils/tinymix.c
index a7e7c05..3f733ba 100644
--- a/utils/tinymix.c
+++ b/utils/tinymix.c
@@ -124,7 +124,12 @@ int main(int argc, char **argv)
mixer_close(mixer);
return EXIT_FAILURE;
}
- tinymix_set_value(mixer, argv[optind + 1], &argv[optind + 2], argc - 2);
+ if ((optind + 2) >= argc) {
+ fprintf(stderr, "no value(s) specified\n");
+ mixer_close(mixer);
+ return EXIT_FAILURE;
+ }
+ tinymix_set_value(mixer, argv[optind + 1], &argv[optind + 2], argc - 3);
} else if (strcmp(cmd, "controls") == 0) {
tinymix_list_controls(mixer, 0);
} else if (strcmp(cmd, "contents") == 0) {