]> git.sur5r.net Git - openldap/commitdiff
Added 'W' fmt char for BVarrays
authorHoward Chu <hyc@openldap.org>
Wed, 2 Jan 2002 08:50:07 +0000 (08:50 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 2 Jan 2002 08:50:07 +0000 (08:50 +0000)
libraries/liblber/decode.c
libraries/liblber/encode.c

index 18d3666508cd0c327e710bb0f279d4cb9028d318..305e766a76f776a419380a88b0841bc77877e36e 100644 (file)
@@ -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;
 
index 08fc871e5be22361c7ed0c4cfb4d9db5e3a93721..c889e44ea46b03c9af0ca9174bef46fbf7c6ad68 100644 (file)
@@ -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;