meminfo: fix g++ warning for oob write
g++ doesn't realize that read can only return -1
This commit is contained in:
parent
e8d20bc653
commit
adbbdf73c4
|
@ -45,7 +45,7 @@ int main()
|
||||||
|
|
||||||
while (ssize_t nread = read(fd, path_buffer, sizeof(path_buffer) - 1))
|
while (ssize_t nread = read(fd, path_buffer, sizeof(path_buffer) - 1))
|
||||||
{
|
{
|
||||||
if (nread == -1)
|
if (nread < 0)
|
||||||
{
|
{
|
||||||
perror("read");
|
perror("read");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue