From 59f04eba9ed32a7178e84e4e1a0a503a859a7889 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 12 Mar 2026 05:13:44 +0000 Subject: util/spkmodem-recv: don't exit in print_stats i treated ftell errors as fatal, but if fttell fails with ESPIPE, and someone's using -d, the program may exit immediately, even though there's no problem. instead, skip printing the offset (basically no debug). this fixes a bug that i introduced myself, when i forked this code, because i added that error check; the GNU code didn't have any check whatsoever. Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index 52466215..ed3d41be 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -239,8 +239,14 @@ print_stats(struct decoder_state *st) long pos; pos = ftell(stdin); - if (pos == -1) - err(errno, "ftell"); + + if (pos == -1) { + printf("%d %d %d\n", + st->freq_data, + st->freq_separator, + FREQ_DATA_THRESHOLD); + return; + } printf("%d %d %d @%ld\n", st->freq_data, -- cgit v1.2.1