projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e4dc85
)
opened the file before the path concatenates, what an idiot
author
Ali H. Fardan
<raiz@firemail.cc>
Wed, 31 Aug 2016 11:29:27 +0000
(14:29 +0300)
committer
Ali H. Fardan
<raiz@firemail.cc>
Wed, 31 Aug 2016 11:29:27 +0000
(14:29 +0300)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index f070e1d7d27c2a95fc91bd2a65e968fe71e6ba81..a9aeecbf6e66109fbce8eff66acb268bd1f09982 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-564,12
+564,14
@@
wifi_perc(const char *wificard)
char path[64];
char status[5];
char needle[strlen(wificard)+2];
- FILE *fp
= fopen(path, "r")
;
+ FILE *fp;
strlcpy(path, "/sys/class/net/", sizeof(path));
strlcat(path, wificard, sizeof(path));
strlcat(path, "/operstate", sizeof(path));
+ fp = fopen(path, "r");
+
if(fp == NULL) {
fprintf(stderr, "Error opening wifi operstate file: %s\n",
strerror(errno));