Minor cleanup

This commit is contained in:
Kurt Zeilenga 2000-06-14 21:11:56 +00:00
parent 89da861b89
commit b7d1b10bca
4 changed files with 14 additions and 8 deletions

View File

@ -231,9 +231,9 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
if ( sb->sb_debug ) {
ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug,
"ber_flush: %ld bytes to sd %ld%s\n", towrite,
(long) sb->sb_fd, ber->ber_rwptr != ber->ber_buf ?
" (re-flush)" : "" );
"ber_flush: %ld bytes to sd %ld%s\n",
towrite, (long) sb->sb_fd,
ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug,
ber->ber_rwptr, towrite );
}
@ -523,8 +523,10 @@ ber_get_next(
}
do {
/* reading the tag... */
if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0)
if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0) {
return LBER_DEFAULT;
}
if (! (ber->ber_rwptr[0] & LBER_MORE_TAG_MASK) ) {
ber->ber_tag>>=sizeof(ber->ber_tag) -
((char *) &ber->ber_tag - ber->ber_rwptr);
@ -532,6 +534,7 @@ ber_get_next(
goto get_lenbyte;
}
} while( PTR_IN_VAR(ber->ber_rwptr, ber->ber_tag ));
errno = ERANGE; /* this is a serious error. */
return LBER_DEFAULT;
}

View File

@ -86,7 +86,7 @@ do_add( Connection *conn, Operation *op )
e->e_attrs = NULL;
e->e_private = NULL;
Debug( LDAP_DEBUG_ARGS, " do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
Debug( LDAP_DEBUG_ARGS, "do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
/* get the attrs */
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;

View File

@ -975,9 +975,9 @@ connection_input(
}
errno = 0;
if ( (tag = ber_get_next( conn->c_sb, &len, conn->c_currentber ))
!= LDAP_TAG_MESSAGE )
{
tag = ber_get_next( conn->c_sb, &len, conn->c_currentber );
if ( tag != LDAP_TAG_MESSAGE ) {
int err = errno;
ber_socket_t sd;

View File

@ -137,18 +137,21 @@ dn_validate( char *dn )
*d++ = *s;
}
break;
case B4SEPARATOR:
if ( RDN_SEPARATOR( *s ) ) {
state = B4TYPE;
*d++ = *s;
}
break;
default:
dn = NULL;
Debug( LDAP_DEBUG_ANY,
"dn_validate - unknown state %d\n", state, 0, 0 );
break;
}
if ( *s == '\\' ) {
gotesc = 1;
} else {