mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:31:46 +00:00
[c-host] linux: simplify read from device
This commit is contained in:
parent
b275ac5765
commit
22e5b323c8
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue