[c-host] linux: simplify read from device

This commit is contained in:
Geoffrey McRae 2019-03-01 21:12:42 +11:00
parent b275ac5765
commit 22e5b323c8

View File

@ -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);