For ITS#6215: No need to maintain ber->ber_usertag except at ber_printf "!"

This commit is contained in:
Hallvard Furuseth 2009-07-29 17:21:54 +00:00
parent 4bed42ae5a
commit 29aa1d07c7

View File

@ -519,10 +519,16 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
BEREncodeCallback *f;
void *p;
ber->ber_usertag = 0;
f = va_arg( ap, BEREncodeCallback * );
p = va_arg( ap, void * );
rc = (*f)( ber, p );
if ( ber->ber_usertag ) {
ber->ber_usertag = 0;
goto next;
}
} break;
case 'b': /* boolean */
@ -579,7 +585,7 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
case 't': /* tag for the next element */
ber->ber_tag = va_arg( ap, ber_tag_t );
ber->ber_usertag = 1;
break;
goto next;
case 'v': /* vector of strings */
if ( (ss = va_arg( ap, char ** )) == NULL )
@ -636,11 +642,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
break;
}
if ( ber->ber_usertag == 0 ) {
ber->ber_tag = LBER_DEFAULT;
} else {
ber->ber_usertag = 0;
}
next:;
}
va_end( ap );