]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/charray.c
ITS#6254
[openldap] / libraries / libldap / charray.c
index 57e2955eee17e2ff615921b8cc588a111494aa96..6692428182765c39507db52a996e58a38f717c59 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -191,10 +191,10 @@ ldap_str2charray( const char *str_in, const char *brkstr )
        }
 
        i = 1;
-       for ( s = str; *s; s++ ) {
-               if ( ldap_utf8_strchr( brkstr, s ) != NULL ) {
-                       i++;
-               }
+       for ( s = str; ; LDAP_UTF8_INCR(s) ) {
+               s = ldap_utf8_strpbrk( s, brkstr );
+               if ( !s ) break;
+               i++;
        }
 
        res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) );