mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-08 11:44:10 +00:00
[c-host] linux: simplify read from device
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user