]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/etest.c
hex escape everything requires escape (uncomment #define PRETTY_ESCAPE to revert...
[openldap] / libraries / liblber / etest.c
index 0dcf7d71117c780ad42e990dcac3183cf2cf54fb..863cd7e563d3e9bbf3ccaeae368a1264934e98a5 100644 (file)
 
 #include "lber.h"
 
-static void usage( char *name )
+static void usage( const char *name )
 {
        fprintf( stderr, "usage: %s fmtstring\n", name );
 }
 
-static char* getbuf() {
+static char* getbuf( void ) {
        char *p;
        static char buf[128];
 
@@ -75,7 +75,9 @@ main( int argc, char **argv )
        fd = fileno(stdout);
 #endif
 
-       sb = ber_sockbuf_alloc_fd( fd );
+       sb = ber_sockbuf_alloc();
+       ber_sockbuf_add_io( sb, &ber_sockbuf_io_fd, LBER_SBIOD_LEVEL_PROVIDER,
+               (void *)&fd );
 
        if( sb == NULL ) {
                perror( "ber_sockbuf_alloc_fd" );
@@ -142,7 +144,7 @@ main( int argc, char **argv )
        }
 
        fprintf(stderr, "encode: end\n" );
-       if( ber_printf( ber, /*{*/ "}" ) == -1 ) {
+       if( ber_printf( ber, /*{*/ "N}" ) == -1 ) {
                perror( /*{*/ "ber_printf }" );
                return( EXIT_FAILURE );
        }