X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/c0647e946ff50045eb7b479c9f05d23ef3acc2ca..e6158e300d3134e44f741e01108dd088297c476f:/slstatus.c?ds=sidebyside diff --git a/slstatus.c b/slstatus.c index 76f0518..70d8fbb 100644 --- a/slstatus.c +++ b/slstatus.c @@ -37,8 +37,6 @@ struct arg { const char *args; }; -static unsigned short int delay; - static char *smprintf(const char *, ...); static char *battery_perc(const char *); static char *cpu_perc(void); @@ -65,6 +63,7 @@ static char *vol_perc(const char *); static char *wifi_perc(const char *); static char *wifi_essid(const char *); +static unsigned short int delay; static Display *dpy; #include "config.h" @@ -261,7 +260,7 @@ hostname(void) fgets(hostname, sizeof(hostname), fp); /* FIXME: needs improvement */ - memset(&hostname[strlen(hostname)-1], '\0', + memset(&hostname[strlen(hostname)], '\0', sizeof(hostname) - strlen(hostname)); fclose(fp);