summaryrefslogtreecommitdiff
path: root/procps/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'procps/top.c')
-rw-r--r--procps/top.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/procps/top.c b/procps/top.c
index 62f9421..3d67c3c 100644
--- 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 */