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:
7df1f1d
)
top: fix memset length (sizeof(ptr) vs sizeof(array) problem)
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 29 Jul 2014 15:00:30 +0000
(17:00 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 29 Jul 2014 15:00:30 +0000
(17:00 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
procps/top.c
patch
|
blob
|
history
diff --git
a/procps/top.c
b/procps/top.c
index 62f9421af4aa3b5799d0e704312ebdf2a7846d1b..3d67c3cfd6e0eae9b826840b918595cc4c811619 100644
(file)
--- a/
procps/top.c
+++ b/
procps/top.c
@@
-536,7
+536,7
@@
static void parse_meminfo(unsigned long meminfo[MI_MAX])
FILE *f;
int i;
- memset(meminfo, 0, sizeof(meminfo
)
);
+ memset(meminfo, 0, sizeof(meminfo
[0]) * MI_MAX
);
f = xfopen_for_read("meminfo");
while (fgets(buf, sizeof(buf), f) != NULL) {
char *c = strchr(buf, ':');
@@
-550,7
+550,6
@@
static void parse_meminfo(unsigned long meminfo[MI_MAX])
fclose(f);
}
-
static unsigned long display_header(int scr_width, int *lines_rem_p)
{
char scrbuf[100]; /* [80] was a bit too low on 8Gb ram box */