]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/utf-8-conv.c
Added thread-pool getkey/setkey functions
[openldap] / libraries / libldap / utf-8-conv.c
index bc0149b3da31492db4e74aa5f109d644c7d86400..9b51bcd6f6c041ac52fd0743e3178bef0a1fe534 100644 (file)
@@ -85,9 +85,9 @@ ldap_x_utf8_to_wc ( wchar_t *wchar, const char *utf8char )
                utf8char = "";
 
        /* Get UTF-8 sequence length from 1st byte */
-       utflen = LDAP_UTF8_CHARLEN(utf8char);
+       utflen = LDAP_UTF8_CHARLEN2(utf8char, utflen);
        
-       if( utflen==0 || utflen > LDAP_MAX_UTF8_LEN )
+       if( utflen==0 || utflen > (int)LDAP_MAX_UTF8_LEN )
                return -1;                                                                      /* Invalid input */
 
        /* First byte minus length tag */
@@ -130,9 +130,9 @@ ldap_x_utf8s_to_wcs ( wchar_t *wcstr, const char *utf8str, size_t count )
        while ( *utf8str && (wcstr==NULL || wclen<count) )
        {
                /* Get UTF-8 sequence length from 1st byte */
-               utflen = LDAP_UTF8_CHARLEN(utf8str);
+               utflen = LDAP_UTF8_CHARLEN2(utf8str, utflen);
                
-               if( utflen==0 || utflen > LDAP_MAX_UTF8_LEN )
+               if( utflen==0 || utflen > (int)LDAP_MAX_UTF8_LEN )
                        return -1;                                                                      /* Invalid input */
 
                /* First byte minus length tag */