diff options
| -rw-r--r-- | slstatus/components/battery.c | 4 | ||||
| -rw-r--r-- | slstatus/components/wifi.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/slstatus/components/battery.c b/slstatus/components/battery.c index 1c753f9..f2dc393 100644 --- a/slstatus/components/battery.c +++ b/slstatus/components/battery.c @@ -62,7 +62,7 @@ { "Not charging", "o" }, }; size_t i; - char path[PATH_MAX], state[12]; + char path[PATH_MAX], state[13]; if (esnprintf(path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0) return NULL; @@ -81,7 +81,7 @@ { uintmax_t charge_now, current_now, m, h; double timeleft; - char path[PATH_MAX], state[12]; + char path[PATH_MAX], state[13]; if (esnprintf(path, sizeof(path), POWER_SUPPLY_STATUS, bat) < 0) return NULL; diff --git a/slstatus/components/wifi.c b/slstatus/components/wifi.c index 23af201..8b33baa 100644 --- a/slstatus/components/wifi.c +++ b/slstatus/components/wifi.c @@ -110,10 +110,10 @@ } if (strcmp(ifr.ifr_name, interface) != 0) { strcpy(ifr.ifr_name, interface); - if (ioctl(ifsock, SIOCGIFINDEX, &ifr) != 0) { - warn("ioctl 'SIOCGIFINDEX':"); - return -1; - } + } + if (ioctl(ifsock, SIOCGIFINDEX, &ifr) != 0) { + warn("ioctl 'SIOCGIFINDEX':"); + return -1; } return ifr.ifr_ifindex; } |
