mirror of
https://git.busybox.net/busybox.git
synced 2024-12-05 03:23:26 +08:00
top: fix memset length (sizeof(ptr) vs sizeof(array) problem)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
7df1f1dda1
commit
6c6d37ee45
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user