Fix realloc bug and remove use of LDAP_MOD_BVALUES

This commit is contained in:
Kurt Zeilenga 2000-04-19 08:43:37 +00:00
parent 51993c8e79
commit 01de012e1c
2 changed files with 3 additions and 2 deletions

View file

@ -44,7 +44,7 @@ shell_back_modify(
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn );
for ( ; ml != NULL; ml = ml->ml_next ) {
switch ( ml->ml_op & ~LDAP_MOD_BVALUES ) {
switch ( ml->ml_op ) {
case LDAP_MOD_ADD:
fprintf( wfp, "add: %s\n", ml->ml_type );
break;
@ -70,5 +70,4 @@ shell_back_modify(
read_and_send_results( be, conn, op, rfp, NULL, 0 );
fclose( rfp );
return( 0 );
}

View file

@ -43,8 +43,10 @@ read_and_send_results(
}
len = strlen( line );
while ( bp + len - buf > bsize ) {
size_t offset = bp - buf;
bsize += BUFSIZ;
buf = (char *) ch_realloc( buf, bsize );
bp = &buf[offset];
}
strcpy( bp, line );
bp += len;