From 65a6205dabe3fe452adb9e42b6d552c2abd1c46d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 12 Mar 2026 05:17:09 +0000 Subject: util/spkmodem-recv: allow short sample reads fread() may return short reads, whereas the current code assumes either EOF or a full read. change if to a while. really, it's that simple. just loop until it's done. i probably b0rked this myself when refactoring the GNU code. Signed-off-by: Leah Rowe --- util/spkmodem_recv/spkmodem-recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/spkmodem_recv/spkmodem-recv.c') diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index ed3d41be..d5465137 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -190,7 +190,7 @@ read_sample(struct decoder_state *st) { size_t n; - if (st->inpos >= st->inlen) { + while (st->inpos >= st->inlen) { n = fread(st->inbuf, sizeof(st->inbuf[0]), READ_BUF, stdin); -- cgit v1.2.1