util/spkmodem-recv: tidy up frame decoding

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-11 23:34:43 +00:00
parent bf9c4a67f8
commit 42cad20ffd
+4 -2
View File
@@ -113,6 +113,7 @@ static void
decode_pulse(void)
{
size_t n;
size_t frame_size;
int next_ringpos = (ringpos + SAMPLES_PER_FRAME) % MAX_SAMPLES;
@@ -120,9 +121,10 @@ decode_pulse(void)
freq_data += pulse[next_ringpos];
freq_separator -= pulse[next_ringpos];
n = fread(frame + ringpos, 1, sizeof(frame[0]), stdin);
frame_size = sizeof(frame[0]);
n = fread(&frame[ringpos], 1, frame_size, stdin);
if (n != sizeof(frame[0])) {
if (n != frame_size) {
if (feof(stdin))
exit(EXIT_SUCCESS);
if (ferror(stdin))