瀏覽代碼

slow down boy! you opened the file too early!

master
Ali H. Fardan 8 年之前
父節點
當前提交
cd3c084957
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      slstatus.c

+ 2
- 1
slstatus.c 查看文件

@@ -105,7 +105,7 @@ battery_perc(const char *battery)
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 @@ battery_perc(const char *battery)
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,


Loading…
取消
儲存