Null-terminate the hostname buffer.
This commit is contained in:
parent
a76eb95be9
commit
d2a09c18be
1
gnu/dist/libf2c/libU77/hostnm_.c
vendored
1
gnu/dist/libf2c/libU77/hostnm_.c
vendored
@ -36,6 +36,7 @@ integer G77_hostnm_0 (char *name, ftnlen Lname)
|
||||
|
||||
#if HAVE_GETHOSTNAME
|
||||
ret = gethostname (name, Lname);
|
||||
name[Lname - 1] = '\0';
|
||||
if (ret==0) {
|
||||
/* Pad with blanks (assuming gethostname will make an error
|
||||
return if it can't fit in the null). */
|
||||
|
Loading…
Reference in New Issue
Block a user