about summary refs log tree commit diff
path: root/hurd/get-host.c
diff options
context:
space:
mode:
Diffstat (limited to 'hurd/get-host.c')
-rw-r--r--hurd/get-host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hurd/get-host.c b/hurd/get-host.c
index 93890c724e..2794eec3cb 100644
--- a/hurd/get-host.c
+++ b/hurd/get-host.c
@@ -72,7 +72,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
     }
 
   /* Remove newlines in case someone wrote the file by hand.  */
-  while (buf[nread - 1] == '\n' && nread > 0)
+  while (nread > 0 && buf[nread - 1] == '\n')
     buf[--nread] = '\0';
 
   /* Null-terminate the result if there is enough space.  */