]> git.sur5r.net Git - openldap/commitdiff
ber_get_enum() needs int*, not enum*. An enum can have wrong size.
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 10 Jul 2005 09:40:34 +0000 (09:40 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 10 Jul 2005 09:40:34 +0000 (09:40 +0000)
(Enum _members_ have type int, but the enum's _type_ can be compatible
with some other char/integer type which can represent its members.)

libraries/libldap/ppolicy.c

index a54181dca658820ee40f545e738f278a2bb31993..d730f93cdf9352cdd2761b69a9a9d0f24ed0819c 100644 (file)
@@ -134,7 +134,7 @@ ldap_parse_passwordpolicy_control(
        ber_tag_t tag;
        ber_len_t berLen;
         char *last;
-        LDAPPasswordPolicyError err = PP_noError;
+       int err = PP_noError;
         
        assert( ld != NULL );
        assert( LDAP_VALID( ld ) );
@@ -172,7 +172,7 @@ ldap_parse_passwordpolicy_control(
                     
                     break;
                 case PPOLICY_ERROR:
-                    if (ber_get_enum( ber, (int *)&err ) == LBER_DEFAULT) goto exit;
+                    if (ber_get_enum( ber, &err ) == LBER_DEFAULT) goto exit;
                     break;
                 default:
                     goto exit;