X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Fliblber%2Fetest.c;h=d5ad1d31ad6df9bf5c18f570eebfe854f496da72;hb=f2958fe7ef5185f879aab3fd057717733f9635b3;hp=f4d07372c4847ceffecbbd788caa3a5dd56f9d69;hpb=85013a9d985c5d6bbb9ccba230bddbf1e03874b8;p=openldap diff --git a/libraries/liblber/etest.c b/libraries/liblber/etest.c index f4d07372c4..d5ad1d31ad 100644 --- a/libraries/liblber/etest.c +++ b/libraries/liblber/etest.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2003 The OpenLDAP Foundation. + * Copyright 1998-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,6 +64,7 @@ int main( int argc, char **argv ) { char *s; + int tag; int fd, rc; BerElement *ber; @@ -143,10 +144,14 @@ main( int argc, char **argv ) break; case 's': /* string */ - case 't': /* tag for the next element */ buf = getbuf(); rc = ber_printf( ber, fmt, buf ); break; + case 't': /* tag for the next element */ + buf = getbuf(); + tag = atoi(buf); + rc = ber_printf( ber, fmt, tag ); + break; default: fprintf( stderr, "encode: unknown fmt %c\n", *fmt ); @@ -166,8 +171,8 @@ main( int argc, char **argv ) return( EXIT_FAILURE ); } - if ( ber_flush( sb, ber, 1 ) == -1 ) { - perror( "ber_flush" ); + if ( ber_flush2( sb, ber, LBER_FLUSH_FREE_ALWAYS ) == -1 ) { + perror( "ber_flush2" ); return( EXIT_FAILURE ); }