]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/etest.c
ITS#7182 Enable operation and connection monitoring.
[openldap] / libraries / liblber / etest.c
index f4d07372c4847ceffecbbd788caa3a5dd56f9d69..d5ad1d31ad6df9bf5c18f570eebfe854f496da72 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * 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 );
        }