Return proper error message if recording device is not specified.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2012-01-27 09:15:55 +00:00
parent 94fce84763
commit 19e79b284d
1 changed files with 6 additions and 1 deletions

View File

@ -193,13 +193,18 @@ main(int argc, char *argv[])
argc--;
argv++;
continue;
} else if (argc > 1 && strcmp("rec", *argv + 1) == 0) {
} else if (strcmp("rec", *argv + 1) == 0) {
if (**argv != '+' && **argv != '-' &&
**argv != '=' && **argv != '^') {
warnx("unknown modifier: %c", **argv);
dusage = 1;
break;
}
if (argc <= 1) {
warnx("no recording device specified");
dusage = 1;
break;
}
if ((dev = res_name(argv[1], recmask)) == -1) {
warnx("unknown recording device: %s", argv[1]);
dusage = 1;