Browse Source

hostname() null terminaiton subtraction *is* needed

master
Aaron Marcher 9 years ago
committed by Aaron Marcher (drkhsh)
parent
commit
1ad9f2504d
  1. 2
      slstatus.c

2
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);

Loading…
Cancel
Save