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>
This commit is contained in:
Leah Rowe
2026-03-12 05:17:09 +00:00
parent 59f04eba9e
commit 65a6205dab
+1 -1
View File
@@ -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);