diff options
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/get-host.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hurd/get-host.c b/hurd/get-host.c index be8345fbf9..e5d0539275 100644 --- a/hurd/get-host.c +++ b/hurd/get-host.c @@ -65,7 +65,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) } /* If the file is empty, give an empty value. */ - if (nread == 0) + if (nread == 0 && more == 0) { if (buflen != 0) *buf = '\0'; @@ -80,7 +80,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) if (nread < buflen) buf[nread] = '\0'; else - if (buf[nread - 1] != '\0') + if (nread != 0 && buf[nread - 1] != '\0') more = 1; if (more) |