summaryrefslogtreecommitdiff
path: root/slstatus.c
diff options
context:
space:
mode:
authorAli H. Fardan <raiz@firemail.cc>2016-09-14 12:22:03 +0300
committerAli H. Fardan <raiz@firemail.cc>2016-09-14 12:22:03 +0300
commit56fffbce64e2ee66891dbe3f2b8b9b4f9cb284bc (patch)
tree1e59a407265ec2a2db8f7e1a9253c31a04892e3b /slstatus.c
parent6edc959933cc0a8c94ed4571bf668a5fe15ba7aa (diff)
improved hostname()
Diffstat (limited to 'slstatus.c')
-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);