commit 1ad9f2504d3b547ceb3e6e92215bc2d42164e782
parent bca9b5246a7fa3dc3fb66b3120be5b674fd16ecb
Author: Aaron Marcher <info@nulltime.net>
Date: Wed, 14 Sep 2016 11:04:24 +0200
hostname() null terminaiton subtraction *is* needed
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/slstatus.c b/slstatus.c
@@ -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);