]> git.sur5r.net Git - openldap/commitdiff
Fixes ITS#1935
authorStig Venaas <venaas@openldap.org>
Tue, 16 Jul 2002 02:38:14 +0000 (02:38 +0000)
committerStig Venaas <venaas@openldap.org>
Tue, 16 Jul 2002 02:38:14 +0000 (02:38 +0000)
libraries/libldap/url.c

index 6b9e756cd3f4ed617a113b78d24326c965d7a26d..8bf8bd56d56f7a9d86cb7d1c5f897c48a86f49af 100644 (file)
@@ -1137,12 +1137,14 @@ ldap_pvt_hex_unescape( char *s )
 
        for ( p = s; *s != '\0'; ++s ) {
                if ( *s == '%' ) {
-                       if ( *++s != '\0' ) {
-                               *p = ldap_int_unhex( *s ) << 4;
+                       if ( *++s == '\0' ) {
+                               break;
                        }
-                       if ( *++s != '\0' ) {
-                               *p++ += ldap_int_unhex( *s );
+                       *p = ldap_int_unhex( *s ) << 4;
+                       if ( *++s == '\0' ) {
+                               break;
                        }
+                       *p++ += ldap_int_unhex( *s );
                } else {
                        *p++ = *s;
                }