Menu

#11 Fix incorrect display value of BigFree

Unstable (example)
open
nobody
None
5
2019-03-29
2019-03-29
WHR
No

When compiling without macro 'LARGEMEM' for old kernels, the value of 'BigFree' variable are printed on terminal with '%f' in mvprintw(3), without first converting its type from 'long int' to 'double'.

Fix:

--- lmon16i.c.orig  2019-02-05 23:55:22.000000000 +0800
+++ lmon16i.c   2019-03-29 12:40:59.435712345 +0800
@@ -6515,7 +6515,7 @@
              p->mem.cached / 1024.0, p->mem.active / 1024.0);
        mvwprintw(padmem, 5, 68, "MB");
        mvwprintw(padmem, 6, 55, "bigfree=%10.1f",
-             p->mem.bigfree / 1024);
+             p->mem.bigfree / 1024.0);
 #endif      /*LARGEMEM*/
            mvwprintw(padmem, 7, 1,
                  "Buffers=%10.1f Swapcached=%10.1f  Inactive =%10.1f",

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.