diff options
author | Ali H. Fardan <raiz@firemail.cc> | 2016-09-14 12:22:03 +0300 |
---|---|---|
committer | Ali H. Fardan <raiz@firemail.cc> | 2016-09-14 12:22:03 +0300 |
commit | 56fffbce64e2ee66891dbe3f2b8b9b4f9cb284bc (patch) | |
tree | 1e59a407265ec2a2db8f7e1a9253c31a04892e3b /slstatus.c | |
parent | 6edc959933cc0a8c94ed4571bf668a5fe15ba7aa (diff) |
improved hostname()
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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); |