]> git.sur5r.net Git - openldap/commitdiff
Fix LBER_ERROR vs. -1 confusion.
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 19 Jan 2003 13:10:17 +0000 (13:10 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 19 Jan 2003 13:10:17 +0000 (13:10 +0000)
clients/tools/ldapcompare.c
clients/tools/ldapsearch.c
doc/man/man3/lber-decode.3
doc/man/man3/lber-encode.3
libraries/libldap/passwd.c
servers/slapd/back-bdb/search.c

index d3c7c06260c35096846e87d57aad6a438765afd9..b357c6d09a2c7a8f9bf23b4d01d115ffe3622146 100644 (file)
@@ -152,7 +152,7 @@ main( int argc, char **argv )
                bvalue.bv_len = lutil_b64_pton( &sep[1],
                        bvalue.bv_val, strlen( &sep[1] ));
 
-               if (bvalue.bv_len == -1) {
+               if (bvalue.bv_len == (ber_len_t)-1) {
                        fprintf(stderr, "base64 decode error\n");
                        exit(-1);
                }
index c18ae86fd8d2b9943e9d8ce8b0246b2811027da8..e54628722429640177bd3b45b8c96536636939eb 100644 (file)
@@ -543,13 +543,13 @@ getNextPage:
                        }
 
                        err = ber_printf( seber, "{b}", abs(subentries) == 1 ? 0 : 1 );
-               if ( err == LBER_ERROR ) {
+               if ( err == -1 ) {
                                ber_free( seber, 1 );
                                fprintf( stderr, "Subentries control encoding error!\n" );
                                return EXIT_FAILURE;
                        }
 
-                       if ( ber_flatten2( seber, &c[i].ldctl_value, 0 ) == LBER_ERROR ) {
+                       if ( ber_flatten2( seber, &c[i].ldctl_value, 0 ) == -1 ) {
                                return EXIT_FAILURE;
                        }
 
@@ -594,7 +594,7 @@ getNextPage:
                                return EXIT_FAILURE;
                        }
 
-                       if ( ber_flatten2( vrber, &c[i].ldctl_value, 0 ) == LBER_ERROR ) {
+                       if ( ber_flatten2( vrber, &c[i].ldctl_value, 0 ) == -1 ) {
                                return EXIT_FAILURE;
                        }
 
@@ -609,7 +609,7 @@ getNextPage:
                        }
 
                        ber_printf( prber, "{iO}", pageSize, &cookie );
-                       if ( ber_flatten2( prber, &c[i].ldctl_value, 0 ) == LBER_ERROR ) {
+                       if ( ber_flatten2( prber, &c[i].ldctl_value, 0 ) == -1 ) {
                                return EXIT_FAILURE;
                        }
                        
index a01f04809e2d61d15c0f186e300f653fe232b058..0494010a43e142963d1313505fd43e48e3e3a11e 100644 (file)
@@ -336,7 +336,7 @@ as follows.
 .fi
 .SH ERRORS
 If an error occurs during decoding, generally these routines return
-LBER_ERROR (\-1).
+LBER_ERROR ((ber_tag_t)\-1).
 .LP
 .SH NOTES
 .LP
index 07a19b1088dd3e2d3cf209eec849a537709c0ad7..c9a11150748a606926be585de2232fbc6c6724df 100644 (file)
@@ -62,7 +62,7 @@ applications that need more control than
 .BR ber_printf ()
 provides.  In
 general, these routines return the length of the element encoded, or
-LBER_ERROR if an error occurred.
+-1 if an error occurred.
 .LP
 The
 .BR ber_alloc_t ()
@@ -250,14 +250,14 @@ can be achieved like so:
       rc = ber_printf( ber, "{siiiib{v}}", dn, scope, ali,
           size, time, attrsonly, attrs );
 
-      if( rc == LBER_ERROR ) {
+      if( rc == -1 ) {
               /* error */
       } else {
               /* success */
       }
 .fi
 .SH ERRORS
-If an error occurs during encoding, generally these routines return LBER_ERROR.
+If an error occurs during encoding, generally these routines return -1.
 .LP
 .SH NOTES
 .LP
index 245e9e99c52e38b084940b62ab1d0b4a4f36197e..e1682c5a900180e646774ac53d924ebaaac91276 100644 (file)
@@ -52,7 +52,7 @@ int ldap_parse_passwd(
                tag = ber_scanf( ber, "{o}", newpasswd );
                ber_free( ber, 1 );
 
-               if( tag == -1 ) {
+               if( tag == LBER_ERROR ) {
                        rc = ld->ld_errno = LDAP_DECODING_ERROR;
                }
        }
index 47877341cfe7dacd37953e426a98e7a3ec592f36..f85c8b5c098fc4788a12435ea7db2d3bc9d830bf 100644 (file)
@@ -1135,7 +1135,7 @@ send_pagerequest_response(
         */
        ber_printf( ber, "{iO}", tentries, &cookie ); 
 
-       if ( ber_flatten2( ber, &ctrls[0]->ldctl_value, 0 ) == LBER_ERROR ) {
+       if ( ber_flatten2( ber, &ctrls[0]->ldctl_value, 0 ) == -1 ) {
                goto done;
        }