diff options
author | Aaron Marcher <info@nulltime.net> | 2016-09-14 11:27:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 11:27:19 +0200 |
commit | 5609b9d9dec24b8771280e9eace955fe17663236 (patch) | |
tree | 1e59a407265ec2a2db8f7e1a9253c31a04892e3b | |
parent | 6edc959933cc0a8c94ed4571bf668a5fe15ba7aa (diff) | |
parent | 56fffbce64e2ee66891dbe3f2b8b9b4f9cb284bc (diff) |
Merge pull request #17 from R41z/master
improved hostname()
-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); |