From: Howard Chu Date: Fri, 31 Mar 2006 21:30:06 +0000 (+0000) Subject: cleanup NULL string handling X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~73 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1c0d2ad7ae2bed2e5ce32e37fc02c0de36ca1f78;p=openldap cleanup NULL string handling --- diff --git a/libraries/libldap/utf-8-conv.c b/libraries/libldap/utf-8-conv.c index 29809deca6..14cd89e494 100644 --- a/libraries/libldap/utf-8-conv.c +++ b/libraries/libldap/utf-8-conv.c @@ -130,7 +130,11 @@ ldap_x_utf8s_to_wcs ( wchar_t *wcstr, const char *utf8str, size_t count ) /* If input ptr is NULL, treat it as empty string. */ - if (utf8str == NULL) utf8str = ""; + if (utf8str == NULL) { + if ( wcstr ) + *wcstr = 0; + return 0; + } /* Examine next UTF-8 character. If output buffer is NULL, ignore count */ while ( *utf8str && (wcstr==NULL || wclen