slow down boy! you opened the file too early!
Ali H. Fardan raiz@firemail.cc
Wed, 31 Aug 2016 06:00:14 +0300
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -105,7 +105,7 @@ {
int now, full, perc; char batterynowfile[64]; char batteryfullfile[64]; - FILE *fp = fopen(batterynowfile, "r"); + FILE *fp; strlcpy(batterynowfile, BATTERY_PATH, sizeof(batterynowfile)); strlcat(batterynowfile, battery, sizeof(batterynowfile));@@ -117,6 +117,7 @@ strlcat(batteryfullfile, battery, sizeof(batteryfullfile));
strlcat(batteryfullfile, "/", sizeof(batteryfullfile)); strlcat(batteryfullfile, BATTERY_FULL, sizeof(batteryfullfile)); + fp = fopen(batterynowfile, "r"); if (fp == NULL ) { fprintf(stderr, "Error opening battery file: %s: %s\n", batterynowfile,