fixed
This commit is contained in:
parent
f9ccaaa80b
commit
0bb1464704
3 changed files with 4 additions and 3 deletions
|
@ -190,6 +190,7 @@ int GetMem(const char *title, const FETCH fetch) {
|
|||
if (fscanf(fp, "MemTotal: %lu kB\nMemFree: %lu kB", &total, &free) < 0)
|
||||
return 1;
|
||||
|
||||
fclose(fp);
|
||||
#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);
|
||||
|
||||
|
@ -201,7 +202,6 @@ int GetMem(const char *title, const FETCH fetch) {
|
|||
|
||||
#endif
|
||||
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -305,8 +305,9 @@ int GetBattery(const char *title, const FETCH fetch) {
|
|||
if (fscanf(fp, "%d", &capacity) < 0)
|
||||
return 1;
|
||||
|
||||
fclose(fp);
|
||||
|
||||
printf("%s%s%s", fetch.color, title, fetch.font_color);
|
||||
DrawBar(capacity, 100);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue