aboutsummaryrefslogtreecommitdiff
path: root/modules/computer/memory.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-07-12 00:46:38 -0500
committerLeandro Pereira <leandro@hardinfo.org>2017-07-12 19:38:41 -0700
commitfb2910e7a2931ff84c8f3f859e76623a295275f8 (patch)
tree1a408b35be2ffd1abc906c95824ab673945bc795 /modules/computer/memory.c
parent3824849f670ea9249a35a72b1f8f475e5f3fdea3 (diff)
Fix Computer -> Summary -> RAM for non-English
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/computer/memory.c')
-rw-r--r--modules/computer/memory.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/computer/memory.c b/modules/computer/memory.c
index 3d320e8a..44b83df4 100644
--- a/modules/computer/memory.c
+++ b/modules/computer/memory.c
@@ -28,23 +28,23 @@ computer_get_memory(void)
procmem = fopen("/proc/meminfo", "r");
if (!procmem)
- return NULL;
+ return NULL;
mi = g_new0(MemoryInfo, 1);
while (fgets(buffer, 128, procmem)) {
- gchar **tmp = g_strsplit(buffer, ":", 2);
+ gchar **tmp = g_strsplit(buffer, ":", 2);
- tmp[0] = g_strstrip(tmp[0]);
- tmp[1] = g_strstrip(tmp[1]);
+ tmp[0] = g_strstrip(tmp[0]);
+ tmp[1] = g_strstrip(tmp[1]);
- get_int("MemTotal", mi->total);
- get_int("MemFree", mi->free);
- get_int("Cached", mi->cached);
+ get_int("MemTotal", mi->total);
+ get_int("MemFree", mi->free);
+ get_int("Cached", mi->cached);
- g_strfreev(tmp);
+ g_strfreev(tmp);
}
fclose(procmem);
-
+
mi->used = mi->total - mi->free;
mi->total /= 1000;