projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21302c2
)
Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top.
author
Rob Landley
<rob@landley.net>
Tue, 27 Jun 2006 18:14:12 +0000
(18:14 -0000)
committer
Rob Landley
<rob@landley.net>
Tue, 27 Jun 2006 18:14:12 +0000
(18:14 -0000)
libbb/procps.c
patch
|
blob
|
history
diff --git
a/libbb/procps.c
b/libbb/procps.c
index b483a326c39575240a851165b4cfc070efd0238b..85549c995547255a6a3732f50aa2ac819d6d99cc 100644
(file)
--- a/
libbb/procps.c
+++ b/
libbb/procps.c
@@
-28,7
+28,8
@@
static int read_to_buf(const char *filename, void *buf)
fd = open(filename, O_RDONLY);
if(fd < 0)
return -1;
- ret = read(fd, buf, PROCPS_BUFSIZE);
+ ret = read(fd, buf, PROCPS_BUFSIZE-1);
+ ((char *)buf)[ret > 0 ? ret : 0] = 0;
close(fd);
return ret;
}