X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fstring.c;h=ee275baec66cee7c47a0806484fb8e1ebde1e1ec;hb=fe86a81e251bda73f04841f765b2a93ac0354396;hp=cd9994ad0601a6ae96c145bd5ad84f42521e3330;hpb=403f4479bc9f9a864122d4aeecf7284408918302;p=openldap diff --git a/libraries/libldap/string.c b/libraries/libldap/string.c index cd9994ad06..ee275baec6 100644 --- a/libraries/libldap/string.c +++ b/libraries/libldap/string.c @@ -1,9 +1,14 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ +/* + * Locale-specific 1-byte character versions + * See utf-8.c for UTF-8 versions + */ + #include "portable.h" #include @@ -92,28 +97,16 @@ char *(ldap_pvt_strtok)( char *str, const char *delim, char **pos ) return str; } -char * -(ldap_pvt_strdup)( const char *s ) -{ - char *p; - size_t len = strlen( s ) + 1; - - if ( (p = (char *) malloc( len )) == NULL ) { - return( NULL ); - } - - memcpy( p, s, len ); - return( p ); -} - char * ldap_pvt_str2upper( char *str ) { char *s; /* to upper */ - for ( s = str; *s; s++ ) { - *s = TOUPPER( (unsigned char) *s ); + if ( str ) { + for ( s = str; *s; s++ ) { + *s = TOUPPER( (unsigned char) *s ); + } } return( str ); @@ -125,8 +118,10 @@ ldap_pvt_str2lower( char *str ) char *s; /* to lower */ - for ( s = str; *s; s++ ) { - *s = TOLOWER( (unsigned char) *s ); + if ( str ) { + for ( s = str; *s; s++ ) { + *s = TOLOWER( (unsigned char) *s ); + } } return( str );