improved hostname()
Ali H. Fardan raiz@firemail.cc
Wed, 14 Sep 2016 12:22:03 +0300
1 files changed,
1 insertions(+),
3 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -272,9 +272,7 @@ return smprintf(UNKNOWN_STR);
} fgets(hostname, sizeof(hostname), fp); - /* FIXME: needs improvement */ - memset(&hostname[strlen(hostname)-1], '\0', - sizeof(hostname) - strlen(hostname)); + hostname[strlen(hostname)-1] = '\0'; fclose(fp); return smprintf("%s", hostname);