diff options
| -rw-r--r-- | libbb/procps.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index b483a326c..85549c995 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
| @@ -28,7 +28,8 @@ static int read_to_buf(const char *filename, void *buf) | |||
| 28 | fd = open(filename, O_RDONLY); | 28 | fd = open(filename, O_RDONLY); |
| 29 | if(fd < 0) | 29 | if(fd < 0) |
| 30 | return -1; | 30 | return -1; |
| 31 | ret = read(fd, buf, PROCPS_BUFSIZE); | 31 | ret = read(fd, buf, PROCPS_BUFSIZE-1); |
| 32 | ((char *)buf)[ret > 0 ? ret : 0] = 0; | ||
| 32 | close(fd); | 33 | close(fd); |
| 33 | return ret; | 34 | return ret; |
| 34 | } | 35 | } |
