]> git.sur5r.net Git - openldap/blobdiff - libraries/libavl/testavl.c
Add security checks to root DSE searches.
[openldap] / libraries / libavl / testavl.c
index 3b927d98072f96efaae967641acdcc0271b6c18f..de948d8bcd48193942f8e7bffeaa6cd9d3867b33 100644 (file)
@@ -1,10 +1,15 @@
 /* testavl.c - Test Tim Howes AVL code */
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 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>
 
 #define AVL_INTERNAL
@@ -47,7 +52,7 @@ main( int argc, char **argv )
                case 'f':       /* find */
                        printf( "data? " );
                        if ( fgets( name, sizeof( name ), stdin ) == NULL )
-                               exit( 0 );
+                               exit( EXIT_SUCCESS );
                        name[ strlen( name ) - 1 ] = '\0';
                        if ( (p = (char *) avl_find( tree, name, (AVL_CMP) strcmp ))
                            == NULL )
@@ -58,7 +63,7 @@ main( int argc, char **argv )
                case 'i':       /* insert */
                        printf( "data? " );
                        if ( fgets( name, sizeof( name ), stdin ) == NULL )
-                               exit( 0 );
+                               exit( EXIT_SUCCESS );
                        name[ strlen( name ) - 1 ] = '\0';
                        if ( avl_insert( &tree, strdup( name ), (AVL_CMP) strcmp, 
                            avl_dup_error ) != 0 )
@@ -67,13 +72,13 @@ main( int argc, char **argv )
                case 'd':       /* delete */
                        printf( "data? " );
                        if ( fgets( name, sizeof( name ), stdin ) == NULL )
-                               exit( 0 );
+                               exit( EXIT_SUCCESS );
                        name[ strlen( name ) - 1 ] = '\0';
                        if ( avl_delete( &tree, name, (AVL_CMP) strcmp ) == NULL )
                                printf( "\nNot found!\n" );
                        break;
                case 'q':       /* quit */
-                       exit( 0 );
+                       exit( EXIT_SUCCESS );
                        break;
                case '\n':
                        break;