/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
main( int argc, char **argv )
{
char *s;
+ int tag;
int fd, rc;
BerElement *ber;
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 );
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 );
}