diff options
author | Leah Rowe <leah@libreboot.org> | 2023-06-13 21:01:15 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-06-13 21:01:15 +0100 |
commit | 5be3d67ced51236cb4e370d8ea755d905a905e1d (patch) | |
tree | a3267be2587dfa09545f983a5b8531736e182069 /util/spkmodem_recv | |
parent | 5c5c1c64fd29f85644771810820ab912e75bc747 (diff) |
util/spkmodem-recv: simplify getopt handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv')
-rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index 16115bd0..b8e28a46 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -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(); |