sophuwu.site > sysgraph
fixed memory not reporting properly.
sophuwu sophie@sophuwu.site
Thu, 03 Aug 2023 16:10:13 +0200
commit

f16ac92368c547b771f19d226c6175e3278deaa0

parent

38df703b4d0beb581a06bc0f6cbb7f0ad4305796

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M main.cppmain.cpp

@@ -24,10 +24,10 @@ };

void meminfo::loadinfo() { FILE* file = fopen("/proc/meminfo", "r"); int line, n = 0; - char c[81]; - fread(c, 1, 81, file); + char c[84]; + fread(c, 1, 84, file); fclose(file); - for (int i = 0; i < 81; i++) { + for (int i = 0; i < 84; i++) { if (c[i] > 47 && c[i] < 58)(n *= 10) += c[i] - 48; else if (c[i] == 10) { n /= 1000;