X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Futf-8.c;h=0d12f010a3bd45612226044c765323d47c5332d5;hb=55dba4395f81f75ad8f247d3c0fad7119fe1ea9d;hp=8538b7304a4efbd01377675beedc9e6a0199528b;hpb=ed9969b1c4b99d7b742c6d88101bd95f72f205e4;p=openldap diff --git a/libraries/libldap/utf-8.c b/libraries/libldap/utf-8.c index 8538b7304a..0d12f010a3 100644 --- a/libraries/libldap/utf-8.c +++ b/libraries/libldap/utf-8.c @@ -109,10 +109,10 @@ int ldap_utf8_charlen( const char * p ) } /* conv UTF-8 to UCS-4, useful for comparisons */ -ber_int_t ldap_utf8_to_ucs4( const char * p ) +ldap_ucs4_t ldap_utf8_to_ucs4( const char * p ) { const unsigned char *c = p; - ber_int_t ch; + ldap_ucs4_t ch; int len, i; static unsigned char mask[] = { 0, 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; @@ -136,7 +136,7 @@ ber_int_t ldap_utf8_to_ucs4( const char * p ) } /* conv UCS-4 to UTF-8, not used */ -int ldap_ucs4_to_utf8( ber_int_t c, char *buf ) +int ldap_ucs4_to_utf8( ldap_ucs4_t c, char *buf ) { int len=0; unsigned char* p = buf; @@ -202,7 +202,7 @@ char* ldap_utf8_next( const char * p ) } for( i=1; i<6; i++ ) { - if ( u[i] & 0xc0 != 0x80 ) { + if ( ( u[i] & 0xc0 ) != 0x80 ) { return (char *) &p[i]; } } @@ -225,7 +225,7 @@ char* ldap_utf8_prev( const char * p ) const unsigned char *u = p; for( i=-1; i>-6 ; i-- ) { - if ( u[i] & 0xc0 != 0x80 ) { + if ( ( u[i] & 0xc0 ) != 0x80 ) { return (char *) &p[i]; } } @@ -255,7 +255,7 @@ int ldap_utf8_copy( char* dst, const char *src ) } for( i=1; i<6; i++ ) { - if ( u[i] & 0xc0 != 0x80 ) { + if ( ( u[i] & 0xc0 ) != 0x80 ) { return i; } dst[i] = src[i]; @@ -418,8 +418,6 @@ ber_len_t (ldap_utf8_strspn)( const char *str, const char *set ) /* like strpbrk(), replaces strchr() as well */ char *(ldap_utf8_strpbrk)( const char *str, const char *set ) { - int len; - for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) { const char *cset;