summaryrefslogtreecommitdiff
path: root/slstatus.c
diff options
context:
space:
mode:
Diffstat (limited to 'slstatus.c')
-rw-r--r--slstatus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slstatus.c b/slstatus.c
index 3ad79c0..4432e18 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -426,7 +426,7 @@ run_command(const char *cmd)
}
fgets(buf, sizeof(buf), fp);
pclose(fp);
- buf[strlen(buf)] = '\0';
+ buf[sizeof(buf)] = '\0';
if ((nlptr = strstr(buf, "\n")) != NULL) {
nlptr[0] = '\0';