summaryrefslogtreecommitdiff
path: root/controller/fw/tools/freq_meas_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'controller/fw/tools/freq_meas_test.c')
-rw-r--r--controller/fw/tools/freq_meas_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/controller/fw/tools/freq_meas_test.c b/controller/fw/tools/freq_meas_test.c
index e80290e..e2900ad 100644
--- a/controller/fw/tools/freq_meas_test.c
+++ b/controller/fw/tools/freq_meas_test.c
@@ -49,9 +49,9 @@ int main(int argc, char **argv) {
}
fprintf(stderr, "Reading %zd samples test data...", st.st_size/sizeof(float));
- size_t nread = 0;
+ ssize_t nread = 0;
while (nread < st.st_size) {
- ssize_t rc = read(fd, buf, st.st_size - nread);
+ ssize_t rc = read(fd, buf + nread, st.st_size - nread);
if (rc == -EINTR || rc == -EAGAIN)
continue;
@@ -100,5 +100,7 @@ int main(int argc, char **argv) {
printf("%09zd %12f\n", i, res);
}
+ free(buf);
+ free(sim_adc_buf);
return 0;
}