projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cba9751
)
merge with 1.10 + local build mods
author
Jim Meyering
<jim@meyering.net>
Fri, 20 May 1994 13:50:55 +0000
(13:50 +0000)
committer
Jim Meyering
<jim@meyering.net>
Fri, 20 May 1994 13:50:55 +0000
(13:50 +0000)
lib/xgethostname.c
patch
|
blob
|
history
diff --git
a/lib/xgethostname.c
b/lib/xgethostname.c
index 86408e775d8b1eb310b3a869b70e48a0f5639241..9973b45bedc6eb17f2f577e30f97794177c235b2 100644
(file)
--- a/
lib/xgethostname.c
+++ b/
lib/xgethostname.c
@@
-46,12
+46,12
@@
xgethostname ()
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);