summaryrefslogtreecommitdiff
path: root/util/spkmodem_recv
diff options
context:
space:
mode:
Diffstat (limited to 'util/spkmodem_recv')
-rw-r--r--util/spkmodem_recv/spkmodem-recv.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c
index 72b85d0c..9776ebc8 100644
--- a/util/spkmodem_recv/spkmodem-recv.c
+++ b/util/spkmodem_recv/spkmodem-recv.c
@@ -44,7 +44,6 @@ char ascii = 0;
void handle_audio(void);
void fetch_sample(void);
-void read_frame(void);
int set_ascii_bit(void);
void print_char(void);
void print_stats(void);
@@ -94,7 +93,10 @@ fetch_sample(void)
freq_data += pulse[next_ringpos];
freq_separator -= pulse[next_ringpos];
- read_frame();
+ fread(frame + ringpos, 1, sizeof(frame[0]), stdin);
+ if (ferror(stdin) != 0)
+ err(ERR(), "Could not read from frame.");
+
if ((pulse[ringpos] = (abs(frame[ringpos]) > THRESHOLD) ? 1 : 0))
++freq_separator;
++ringpos;
@@ -102,14 +104,6 @@ fetch_sample(void)
++sample_count;
}
-void
-read_frame(void)
-{
- if ((fread(frame + ringpos, 1, sizeof(frame[0]), stdin)
- != sizeof(frame[0])) || (ferror(stdin) != 0))
- err(ERR(), "Could not read from frame.");
-}
-
int
set_ascii_bit(void)
{