mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
cleanup NULL string handling
This commit is contained in:
parent
de36ebd08c
commit
1c0d2ad7ae
1 changed files with 5 additions and 1 deletions
|
|
@ -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<count) ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue