From: Kurt Zeilenga Date: Wed, 18 Aug 1999 02:36:23 +0000 (+0000) Subject: Fix server==NULL bugs X-Git-Tag: TWEB_OL_BASE~177 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=17c37bb7c37b7c0f71132c79eeb79ef6a0522fe0;p=openldap Fix server==NULL bugs --- diff --git a/clients/ud/main.c b/clients/ud/main.c index 48df356768..6be4288ae5 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -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 : "" ); 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 ); } }