h.b.furuseth@usit.uio.no wrote:
quanah@OpenLDAP.org writes:
utf-8.c:char * (ldap_utf8_strchr)( const char *str, const char *chr )
I.e., string, character, as normal libc functions.
However, at line 125 in charray.c, it is called as: if ( ldap_utf8_strchr( brkstr, s ) != NULL ) { This order appears to be incorrect.
No. That code counts the number of delimiters characters in the string being split. Since brkstr can contain several characters, the loop checks each "utf-8 character" in str against brkstr.
The code was certainly broken, regardless. If the input string uses any UTF8 characters beyond 0x7f then the simple increment of "s++" would yield invalid characters for most of the iterations of the loop.