diff options
| author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-27 18:14:12 +0000 |
|---|---|---|
| committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-27 18:14:12 +0000 |
| commit | e35c3fcc6ebe2945bcf695cb9d3eeaa2460ecb04 (patch) | |
| tree | 3234b5686b4f3ed15a2c5322c722d860484ab063 | |
| parent | 6ae80e2285917dacda9a130e83e4063fc85c4b88 (diff) | |
| download | busybox-w32-e35c3fcc6ebe2945bcf695cb9d3eeaa2460ecb04.tar.gz busybox-w32-e35c3fcc6ebe2945bcf695cb9d3eeaa2460ecb04.tar.bz2 busybox-w32-e35c3fcc6ebe2945bcf695cb9d3eeaa2460ecb04.zip | |
Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top.
git-svn-id: svn://busybox.net/trunk/busybox@15532 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -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 | } |
