summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-06-13 21:01:15 +0100
committerLeah Rowe <leah@libreboot.org>2023-06-13 21:01:15 +0100
commit5be3d67ced51236cb4e370d8ea755d905a905e1d (patch)
treea3267be2587dfa09545f983a5b8531736e182069 /util
parent5c5c1c64fd29f85644771810820ab912e75bc747 (diff)
util/spkmodem-recv: simplify getopt handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/spkmodem_recv/spkmodem-recv.c6
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();