From 670c66bda96e924edb18d19f6563b596df82b954 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 2 Jan 2002 08:50:07 +0000 Subject: [PATCH] Added 'W' fmt char for BVarrays --- libraries/liblber/decode.c | 3 ++- libraries/liblber/encode.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 18d3666508..305e766a76 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -680,7 +680,8 @@ ber_scanf ( BerElement *ber, case '{': /* begin sequence */ case '[': /* begin set */ - if ( *(fmt + 1) != 'v' && *(fmt + 1) != 'V' ) + if ( *(fmt + 1) != 'v' && *(fmt + 1) != 'V' + && *(fmt + 1) != 'W' ) rc = ber_skip_tag( ber, &len ); break; diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 08fc871e5b..c889e44ea4 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -779,6 +779,16 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... ) } break; + case 'W': /* BVarray */ + if ( (bv = va_arg( ap, BVarray )) == NULL ) + break; + for ( i = 0; bv[i].bv_val != NULL; i++ ) { + if ( (rc = ber_put_berval( ber, &bv[i], + ber->ber_tag )) == -1 ) + break; + } + break; + case '{': /* begin sequence */ rc = ber_start_seq( ber, ber->ber_tag ); break; -- 2.39.5