summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2016-09-14 11:27:19 +0200
committerGitHub <noreply@github.com>2016-09-14 11:27:19 +0200
commit5609b9d9dec24b8771280e9eace955fe17663236 (patch)
tree1e59a407265ec2a2db8f7e1a9253c31a04892e3b
parent6edc959933cc0a8c94ed4571bf668a5fe15ba7aa (diff)
parent56fffbce64e2ee66891dbe3f2b8b9b4f9cb284bc (diff)
Merge pull request #17 from R41z/master
improved hostname()
-rw-r--r--slstatus.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/slstatus.c b/slstatus.c
index 572f964..fefdf6f 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -272,9 +272,7 @@ hostname(void)
}
fgets(hostname, sizeof(hostname), fp);
- /* FIXME: needs improvement */
- memset(&hostname[strlen(hostname)-1], '\0',
- sizeof(hostname) - strlen(hostname));
+ hostname[strlen(hostname)-1] = '\0';
fclose(fp);
return smprintf("%s", hostname);