[Date Prev][Date Next] [Chronological] [Thread] [Top]

fixes for IA5StringNormalize() and NumericStringNormalize() (ITS#605)



Full_Name: Christian Lorenz
Version: 2.0-devel
OS: linux-2.2.14
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (195.243.113.230)


Here's a patch against "schema_init.c,v 1.42": the while-statements
are already fixed in the current version (1.56), but the if-statements
are still faulty.

Have fun!

pkg/ldap/servers/slapd/schema_init.c,v 1.42
===========================================
--- ldap/servers/slapd/schema_init.c.orig   Tue Jun 27 10:46:16 2000
+++ ldap/servers/slapd/schema_init.c    Tue Jun 27 10:49:03 2000
@@ -453,11 +453,12 @@
    p = val->bv_val;

    /* Ignore initial whitespace */
-   while ( isspace( *p++ ) ) {
-       /* EMPTY */  ;
+
+   while ( isspace( *p ) ) {
+       p++;
    }

-   if( *p != '\0' ) {
+   if( *p == '\0' ) {
        ch_free( newval );
        return LDAP_INVALID_SYNTAX;
    }
@@ -900,11 +901,11 @@
    p = val->bv_val;

    /* Ignore initial whitespace */
-   while ( isspace( *p++ ) ) {
-       /* EMPTY */  ;
+   while ( isspace( *p ) ) {
+       p++;
    }

-   if( *p != '\0' ) {
+   if( *p == '\0' ) {
        ch_free( newval );
        return LDAP_INVALID_SYNTAX;
    }