Fix LBER_ERROR vs. -1 confusion.

This commit is contained in:
Hallvard Furuseth 2003-01-19 13:10:17 +00:00
parent 8d0711b08f
commit 1fbbc11811
6 changed files with 11 additions and 11 deletions

View 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);
}

View 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;
}

View 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

View 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

View 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;
}
}

View 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;
}