]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/dtest.c
setting UFN prefix to NULL should clear prefix not cause crash.
[openldap] / libraries / liblber / dtest.c
index f76331f8dc56e5f9094919ce6eacfa9330e8415a..749958b1ee708640bb02095eb34f3fd68242d251 100644 (file)
@@ -1,4 +1,5 @@
 /* dtest.c - lber decoding test program */
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
 
+#include <ac/stdlib.h>
 #include <ac/string.h>
 #include <ac/socket.h>
 #include <ac/unistd.h>
 
 #ifdef HAVE_CONSOLE_H
 #include <console.h>
-#endif /* MACOS */
+#endif
 
-#include "lber-int.h"
+#include <lber.h>
 
 static void usage( char *name )
 {
@@ -41,13 +42,15 @@ main( int argc, char **argv )
        char *s;
        int rc;
 
-       unsigned long tag, len;
+       ber_tag_t       tag;
+       ber_len_t       len;
 
        BerElement      *ber;
        Sockbuf         *sb;
 
        /* enable debugging */
-       ber_int_debug = -1;
+       int ival = -1;
+       ber_set_option( NULL, LBER_OPT_DEBUG_LEVEL, &ival );
 
        if ( argc < 2 ) {
                usage( argv[0] );
@@ -57,7 +60,7 @@ main( int argc, char **argv )
 #ifdef HAVE_CONSOLE_H
        ccommand( &argv );
        cshow( stdout );
-#endif /* MACOS */
+#endif
 
        sb = ber_sockbuf_alloc_fd( fileno(stdin) );
 
@@ -72,7 +75,7 @@ main( int argc, char **argv )
        }
 
        printf("decode: message tag 0x%lx and length %ld\n",
-               tag, len );
+               (unsigned long) tag, (long) len );
 
        for( s = argv[1]; *s; s++ ) {
                char buf[128];