* UTF-8 (in utf-8.c)
*/
-/* returns the number of bytes in the UTF-8 string
- (counting the NULL) */
+/* returns the number of bytes in the UTF-8 string */
LIBLDAP_F (ber_len_t) ldap_utf8_bytes( const char * );
/* returns the number of UTF-8 characters in the string */
LIBLDAP_F (ber_len_t) ldap_utf8_chars( const char * );
*start++ = '\0';
- /* we must have some non-whitespace to skip */
+ /* we must have some whitespace to skip */
while(isspace((unsigned char)*start)) start++;
opt = start;
/*
* return the number of bytes required to hold the
- * NULL-terminated UTF-8 string INCLUDING the
+ * NULL-terminated UTF-8 string NOT INCLUDING the
* termination.
*/
ber_len_t ldap_utf8_bytes( const char * p )
{
- ber_len_t bytes = 0;
+ ber_len_t bytes;
- if( p == NULL ) return bytes;
-
- while( p[bytes++] ) {
+ for( bytes=0; p[bytes]; bytes++ ) {
/* EMPTY */ ;
}