fixed
This commit is contained in:
parent
f9ccaaa80b
commit
0bb1464704
2
build.sh
2
build.sh
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
CC=cc
|
CC=cc
|
||||||
FLAGS="-Os -s"
|
FLAGS="-Os -s -pedantic -Wall -Wextra"
|
||||||
|
|
||||||
$CC -Iinclude -I. src/main.c -c -o main.o &&
|
$CC -Iinclude -I. src/main.c -c -o main.o &&
|
||||||
$CC -Iinclude -I. src/fetch.c -c -o fetch.o &&
|
$CC -Iinclude -I. src/fetch.c -c -o fetch.o &&
|
||||||
|
@ -190,6 +190,7 @@ int GetMem(const char *title, const FETCH fetch) {
|
|||||||
if (fscanf(fp, "MemTotal: %lu kB\nMemFree: %lu kB", &total, &free) < 0)
|
if (fscanf(fp, "MemTotal: %lu kB\nMemFree: %lu kB", &total, &free) < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
#ifdef PRINT_USED_AND_TOTAL_MEM
|
#ifdef PRINT_USED_AND_TOTAL_MEM
|
||||||
printf("%s%s%s%lumb / %lumb", fetch.color, title, fetch.font_color, (uintmax_t)(total - free) / 1024, (uintmax_t)total / 1024);
|
printf("%s%s%s%lumb / %lumb", fetch.color, title, fetch.font_color, (uintmax_t)(total - free) / 1024, (uintmax_t)total / 1024);
|
||||||
|
|
||||||
@ -201,7 +202,6 @@ int GetMem(const char *title, const FETCH fetch) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,8 +305,9 @@ int GetBattery(const char *title, const FETCH fetch) {
|
|||||||
if (fscanf(fp, "%d", &capacity) < 0)
|
if (fscanf(fp, "%d", &capacity) < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
printf("%s%s%s", fetch.color, title, fetch.font_color);
|
printf("%s%s%s", fetch.color, title, fetch.font_color);
|
||||||
DrawBar(capacity, 100);
|
DrawBar(capacity, 100);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user