Fixed to not core dump if not enough arguments are given

with the +rec and -rec options.
This commit is contained in:
mpp 1996-01-15 09:11:17 +00:00
parent 297db4d6f7
commit 1932d7e86d

View File

@ -99,6 +99,10 @@ main(int argc, char *argv[])
if (foo >= SOUND_MIXER_NRDEVICES) {
if (!strcmp("+rec", argv[1]) || !strcmp("-rec", argv[1])) {
if (argc != 3) {
usage();
/* NOTREACHED */
}
for (dev = 0; dev < SOUND_MIXER_NRDEVICES && strcmp(names[dev], argv[2]); dev++);
if (dev >= SOUND_MIXER_NRDEVICES)
usage();