util/spkmodem-recv: simplify getopt handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
fsdg20230625
Leah Rowe 2023-06-13 21:01:15 +01:00
parent 5c5c1c64fd
commit 5be3d67ced
1 changed files with 2 additions and 4 deletions

View File

@ -57,11 +57,9 @@ main(int argc, char *argv[])
if (pledge("stdio", NULL) == -1)
err(ERR(), "pledge");
#endif
while ((c = getopt(argc, argv, "d")) != -1) {
if (c != 'd')
while ((c = getopt(argc, argv, "d")) != -1)
if (!(debug = (c == 'd')))
err(errno = EINVAL, NULL);
debug = 1;
}
setvbuf(stdout, NULL, _IONBF, 0);
while (!feof(stdin))
handle_audio();