aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-30 07:33:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-30 07:33:52 +0000
commitbc2fd372272e4917909358473c07e19c1ce450cc (patch)
treee1d7d7b377a56aaafcb0c4a7dc661a86e2ff2a06
parent0db2c2eb7123385b9fe035b9ce6ee398b592abf8 (diff)
downloadbusybox-w32-bc2fd372272e4917909358473c07e19c1ce450cc.tar.gz
busybox-w32-bc2fd372272e4917909358473c07e19c1ce450cc.tar.bz2
busybox-w32-bc2fd372272e4917909358473c07e19c1ce450cc.zip
nmeter: tiny shrink
-rw-r--r--procps/nmeter.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c
index 96d0bb951..205cb8251 100644
--- a/procps/nmeter.c
+++ b/procps/nmeter.c
@@ -132,11 +132,10 @@ static void readfile_z(char *buf, int sz, const char* fname)
132 132
133 int fd = xopen(fname, O_RDONLY); 133 int fd = xopen(fname, O_RDONLY);
134 buf[0] = '\0'; 134 buf[0] = '\0';
135 if (fd >= 0) { 135 sz = read(fd, buf, sz - 1);
136 sz = read(fd, buf, sz-1); 136 if (sz > 0)
137 if (sz > 0) buf[sz] = '\0'; 137 buf[sz] = '\0';
138 close(fd); 138 close(fd);
139 }
140} 139}
141 140
142static const char* get_file(proc_file *pf) 141static const char* get_file(proc_file *pf)