summaryrefslogtreecommitdiffstats
path: root/linux_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux_spi.c')
-rw-r--r--linux_spi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/linux_spi.c b/linux_spi.c
index de09e607b..e3d7486ee 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -137,8 +137,7 @@ int linux_spi_init(void)
}
char buf[10];
- memset(buf, 0, sizeof(buf));
- if (!fread(buf, 1, sizeof(buf) - 1, fp)) {
+ if (!fgets(buf, sizeof(buf), fp)) {
if (feof(fp))
msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
else