mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
For ITS#6215: No need to maintain ber->ber_usertag except at ber_printf "!"
This commit is contained in:
parent
4bed42ae5a
commit
29aa1d07c7
@ -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 );
|
||||||
|
Loading…
Reference in New Issue
Block a user