diff --git a/c-host/linux/platform.c b/c-host/linux/platform.c index 4912a0ef..37e554c5 100644 --- a/c-host/linux/platform.c +++ b/c-host/linux/platform.c @@ -125,8 +125,8 @@ int main(int argc, char * argv[]) } char size[32]; - int len = read(fd, size, sizeof(size)); - if (len <= 0 || len == sizeof(size)) + int len = read(fd, size, sizeof(size) - 1); + if (len <= 0) { DEBUG_ERROR("Failed to read: %s", file); close(fd);