diff --git a/src/fetch.c b/src/fetch.c index edc5551..5068781 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -191,12 +192,12 @@ int GetMem(const char *title, const FETCH fetch) { if (fp == NULL) return 1; - unsigned int unused = 0, total = 0, available = 0, buffer = 0, cached = 0; - if (fscanf(fp, "MemTotal: %u kB\nMemFree: %u kB\nMemAvailable: %u kB\nBuffers: %u kB\nCached: %u kB", &total, &unused, &available, &buffer, &cached) < 0) + off_t unused = 0, total = 0, available = 0; + if (fscanf(fp, "MemTotal: %ju kB\nMemFree: %ju kB\nMemAvailable: %ju kB", &total, &unused, &available) < 0) return 1; UNUSED(unused); - printf("%s%s%s%umb / %umb", fetch.color, title, fetch.font_color, (total - available - buffer - cached) / 1024, total / 1024); + printf("%s%s%s%jumb / %jumb", fetch.color, title, fetch.font_color, (uintmax_t)(total - available) / 1024, (uintmax_t)total / 1024); fclose(fp); return 0;