Fix server==NULL bugs

This commit is contained in:
Kurt Zeilenga 1999-08-18 02:36:23 +00:00
parent f422f01109
commit 17c37bb7c3

View file

@ -295,13 +295,15 @@ status( void )
if (debug & D_TRACE)
printf("->status()\n");
#endif
printf(" Current server is %s", server);
printf(" Current server is %s", server != NULL ? server : "<default>" );
if ( ld != NULL ) {
char *host = NULL;
ldap_get_option(ld, LDAP_OPT_HOST_NAME, &host);
if (( host != NULL ) && (strcasecmp( host, server ) != 0 )) {
if ( host != NULL &&
( server == NULL || strcasecmp( host, server ) != 0 ) )
{
printf( " (%s)", host );
}
}