Mercurial > gnulib
changeset 19917:c773e1e09761
merge with 1.10 + local build mods
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Fri, 20 May 1994 13:50:55 +0000 |
parents | 6ffb73e5fbc0 |
children | 4dc60de2f8d2 |
files | lib/xgethostname.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/xgethostname.c Fri May 13 14:21:20 1994 +0000 +++ b/lib/xgethostname.c Fri May 20 13:50:55 1994 +0000 @@ -46,12 +46,12 @@ int err; size = INITIAL_HOSTNAME_LENGTH; + hostname = xmalloc (size); while (1) { - hostname = xmalloc (size); hostname[size - 1] = '\0'; err = gethostname (hostname, size); - if (err || hostname[size - 1] == '\0') + if (err == 0 && hostname[size - 1] == '\0') break; size *= 2; hostname = xrealloc (hostname, size);