diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-12 05:17:09 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-12 05:17:09 +0000 |
| commit | 65a6205dabe3fe452adb9e42b6d552c2abd1c46d (patch) | |
| tree | 802e75b692b5e3b22e5bd3faee3125875277a1f1 /util/spkmodem_recv/spkmodem-recv.c | |
| parent | 59f04eba9ed32a7178e84e4e1a0a503a859a7889 (diff) | |
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 <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv/spkmodem-recv.c')
| -rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
