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