From e8889fd107638923bdd6d8929d45a340d02e8ed7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 Jun 2023 15:23:51 +0100 Subject: util/spkmodem-recv: minor code cleanup also be more thorough about errno value when calling pledge. rename variable in a for loop for clarity. Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index 93afd95a..77d64637 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -40,7 +40,7 @@ main(int argc, char *argv[]) #ifdef __OpenBSD__ if (pledge("stdio", NULL) == -1) - err(errno, "pledge"); + err(ERR(), "pledge"); #endif while ((c = getopt(argc, argv, "u")) != -1) { @@ -82,9 +82,8 @@ handle_audio(void) print_char(); - lp = 0; - llp = 0; - for (int i = 0; i < SAMPLES_PER_FRAME; i++) + lp = llp = 0; + for (int sample = 0; sample < SAMPLES_PER_FRAME; sample++) fetch_sample(); } -- cgit v1.2.1