about summary refs log tree commit diff
path: root/nis/nss_nis/nis-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nis/nis-service.c')
-rw-r--r--nis/nss_nis/nis-service.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nis/nss_nis/nis-service.c b/nis/nss_nis/nis-service.c
index 054bc33169..5ec89c8677 100644
--- a/nis/nss_nis/nis-service.c
+++ b/nis/nss_nis/nis-service.c
@@ -169,13 +169,13 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
       if (data->next == NULL)
 	return NSS_STATUS_NOTFOUND;
       p = strcpy (buffer, data->next->val);
-      data->next = data->next->next;
-      while (isspace (*p))
+           while (isspace (*p))
         ++p;
 
-      parse_res = _nss_files_parse_servent (p, serv, buffer, buflen);
-      if (!parse_res && errno == ERANGE)
+      if ((parse_res = _nss_files_parse_servent (p, serv, buffer, 
+						 buflen)) == -1)
         return NSS_STATUS_TRYAGAIN;
+      data->next = data->next->next;
     }
   while (!parse_res);