improved hostname()
This commit is contained in:
parent
6edc959933
commit
56fffbce64
1 changed files with 1 additions and 3 deletions
|
@ -272,9 +272,7 @@ hostname(void)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue