about summary refs log tree commit diff
path: root/nis/nss_nisplus/nisplus-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nisplus/nisplus-service.c')
-rw-r--r--nis/nss_nisplus/nisplus-service.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/nis/nss_nisplus/nisplus-service.c b/nis/nss_nisplus/nisplus-service.c
index 1cb1aec8d7..8f681d3e1c 100644
--- a/nis/nss_nisplus/nisplus-service.c
+++ b/nis/nss_nisplus/nisplus-service.c
@@ -115,7 +115,7 @@ _nss_nisplus_parse_servent (nis_result *result, struct servent *serv,
     {
       /* Skip leading blanks.  */
       while (isspace (*line))
-        line++;
+        ++line;
 
       if (*line == '\0')
         break;
@@ -332,16 +332,17 @@ _nss_nisplus_getservbyname_r (const char *name, const char *protocol,
 					      errnop);
       nis_freeresult (result);
 
-      if (parse_res == -1)
+      if (parse_res < 1)
 	{
-	  *errnop = ERANGE;
-	  return NSS_STATUS_TRYAGAIN;
+	  if (parse_res == -1)
+	    {
+	      *errnop = ERANGE;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
+	  else
+	    return NSS_STATUS_NOTFOUND;
 	}
-
-      if (parse_res)
-	return NSS_STATUS_SUCCESS;
-
-      return NSS_STATUS_NOTFOUND;
+      return NSS_STATUS_SUCCESS;
     }
 }
 
@@ -386,15 +387,16 @@ _nss_nisplus_getservbynumber_r (const int number, const char *protocol,
 					      errnop);
       nis_freeresult (result);
 
-      if (parse_res == -1)
+      if (parse_res < 1)
 	{
-	  *errnop = ERANGE;
-	  return NSS_STATUS_TRYAGAIN;
+	  if (parse_res == -1)
+	    {
+	      *errnop = ERANGE;
+	      return NSS_STATUS_TRYAGAIN;
+	    }
+	  else
+	    return NSS_STATUS_NOTFOUND;
 	}
-
-      if (parse_res)
-	return NSS_STATUS_SUCCESS;
-
-      return NSS_STATUS_NOTFOUND;
+      return NSS_STATUS_SUCCESS;
     }
 }