(ahosts_keys): ai_canonname is NULL for all but the first returned
authordrepper <drepper>
Sat, 14 Aug 2004 06:47:25 +0000 (06:47 +0000)
committerdrepper <drepper>
Sat, 14 Aug 2004 06:47:25 +0000 (06:47 +0000)
entry.  Print name only if not NULL.

nss/getent.c

index bcc363d..4be9535 100644 (file)
@@ -348,7 +348,7 @@ ahosts_keys (int number, char *key[])
                                 &((struct sockaddr_in *) runp->ai_addr)->sin_addr,
                                 buf, sizeof (buf)),
                      sockstr,
-                     runp->ai_canonname);
+                     runp->ai_canonname ?: "");
 
              runp = runp->ai_next;
            }