diff options
author | Aaron Marcher <info@nulltime.net> | 2016-09-14 11:04:24 +0200 |
---|---|---|
committer | Aaron Marcher (drkhsh) <info@nulltime.net> | 2016-09-14 11:04:24 +0200 |
commit | 1ad9f2504d3b547ceb3e6e92215bc2d42164e782 (patch) | |
tree | 83c393a63d9b4c280c7c0018c618546bf618677e | |
parent | bca9b5246a7fa3dc3fb66b3120be5b674fd16ecb (diff) |
hostname() null terminaiton subtraction *is* needed
-rw-r--r-- | slstatus.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |