mirror of
https://github.com/pikami/slstatus.git
synced 2024-11-27 13:55:41 +00:00
hostname() null terminaiton subtraction *is* needed
This commit is contained in:
parent
bca9b5246a
commit
1ad9f2504d
@ -273,7 +273,7 @@ hostname(void)
|
|||||||
|
|
||||||
fgets(hostname, sizeof(hostname), fp);
|
fgets(hostname, sizeof(hostname), fp);
|
||||||
/* FIXME: needs improvement */
|
/* FIXME: needs improvement */
|
||||||
memset(&hostname[strlen(hostname)], '\0',
|
memset(&hostname[strlen(hostname)-1], '\0',
|
||||||
sizeof(hostname) - strlen(hostname));
|
sizeof(hostname) - strlen(hostname));
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user