• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得cocoaqtpythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

external/busybox


Commit MetaInfo

Revisione3325535cd9940a5bae4dc431af1f8b59517165b (tree)
Time2020-04-14 08:07:10
AuthorDenys Vlasenko <vda.linux@goog...>
CommiterMauro Rossi

Log Message

top: fix memset length (sizeof(ptr) vs sizeof(array) problem)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Change Summary

Incremental Difference

--- a/procps/top.c
+++ b/procps/top.c
@@ -536,7 +536,7 @@ static void parse_meminfo(unsigned long meminfo[MI_MAX])
536536 FILE *f;
537537 int i;
538538
539- memset(meminfo, 0, sizeof(meminfo));
539+ memset(meminfo, 0, sizeof(meminfo[0]) * MI_MAX);
540540 f = xfopen_for_read("meminfo");
541541 while (fgets(buf, sizeof(buf), f) != NULL) {
542542 char *c = strchr(buf, ':');
@@ -550,7 +550,6 @@ static void parse_meminfo(unsigned long meminfo[MI_MAX])
550550 fclose(f);
551551 }
552552
553-
554553 static unsigned long display_header(int scr_width, int *lines_rem_p)
555554 {
556555 char scrbuf[100]; /* [80] was a bit too low on 8Gb ram box */