mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[c-host] linux: simplify read from device
This commit is contained in:
parent
b275ac5765
commit
22e5b323c8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user