mirror of https://github.com/xzeldon/htop.git
xread may return -1.
This commit is contained in:
parent
2ee1c41274
commit
28d4cad5fe
|
@ -414,7 +414,7 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons
|
||||||
|
|
||||||
int size = xread(fd, buf, MAX_READ);
|
int size = xread(fd, buf, MAX_READ);
|
||||||
close(fd);
|
close(fd);
|
||||||
if (!size) return false;
|
if (size <= 0) return false;
|
||||||
buf[size] = '\0';
|
buf[size] = '\0';
|
||||||
|
|
||||||
assert(process->pid == atoi(buf));
|
assert(process->pid == atoi(buf));
|
||||||
|
|
Loading…
Reference in New Issue