summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2016-09-14 11:04:24 +0200
committerAaron Marcher (drkhsh) <info@nulltime.net>2016-09-14 11:04:24 +0200
commit1ad9f2504d3b547ceb3e6e92215bc2d42164e782 (patch)
tree83c393a63d9b4c280c7c0018c618546bf618677e
parentbca9b5246a7fa3dc3fb66b3120be5b674fd16ecb (diff)
hostname() null terminaiton subtraction *is* needed
-rw-r--r--slstatus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slstatus.c b/slstatus.c
index ea8fc20..572f964 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -273,7 +273,7 @@ hostname(void)
fgets(hostname, sizeof(hostname), fp);
/* FIXME: needs improvement */
- memset(&hostname[strlen(hostname)], '\0',
+ memset(&hostname[strlen(hostname)-1], '\0',
sizeof(hostname) - strlen(hostname));
fclose(fp);