projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bca9b52
)
hostname() null terminaiton subtraction *is* needed
author
Aaron Marcher
<info@nulltime.net>
Wed, 14 Sep 2016 09:04:24 +0000
(11:04 +0200)
committer
Aaron Marcher (drkhsh)
<info@nulltime.net>
Wed, 14 Sep 2016 09:04:24 +0000
(11:04 +0200)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index ea8fc2093827a391cafbc9e0e631ce4294f88f52..572f9641db3f132c359209d5b8877d31fa88f08e 100644
(file)
--- 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);