]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/test.c
Move LDAPServer, LDAPConn, LDAPRequest, and LDAPCache
[openldap] / libraries / libldap / test.c
index 66e86efb85d0f159be6b70819956226299f71297..013942aa52bf00793c806cc0df2de6af67cef61b 100644 (file)
@@ -78,7 +78,7 @@ get_list( char *prompt )
                        result = (char **) realloc( result,
                            sizeof(char *) * (num + 1) );
 
-               result[num++] = (char *) strdup( buf );
+               result[num++] = (char *) ldap_strdup( buf );
        }
        if ( result == (char **) 0 )
                return( NULL );
@@ -172,7 +172,7 @@ get_modlist( char *prompt1, char *prompt2, char *prompt3 )
                getline( buf, sizeof(buf), stdin, prompt2 );
                if ( buf[0] == '\0' )
                        break;
-               tmp.mod_type = strdup( buf );
+               tmp.mod_type = ldap_strdup( buf );
 
                tmp.mod_values = get_list( prompt3 );
 
@@ -295,9 +295,11 @@ main( int argc, char **argv )
                case 'd':
 #ifdef LDAP_DEBUG
                        ldap_debug = atoi( optarg );
+#ifdef LBER_DEBUG
                        if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
                                lber_debug = ldap_debug;
                        }
+#endif
 #else
                        printf( "Compile with -DLDAP_DEBUG for debugging\n" );
 #endif
@@ -316,12 +318,12 @@ main( int argc, char **argv )
                        break;
 
                case 't':       /* copy ber's to given file */
-                       copyfname = strdup( optarg );
+                       copyfname = ldap_strdup( optarg );
                        copyoptions = LBER_TO_FILE;
                        break;
 
                case 'T':       /* only output ber's to given file */
-                       copyfname = strdup( optarg );
+                       copyfname = ldap_strdup( optarg );
                        copyoptions = (LBER_TO_FILE | LBER_TO_FILE_ONLY);
                        break;
 
@@ -477,9 +479,11 @@ main( int argc, char **argv )
 #ifdef LDAP_DEBUG
                        getline( line, sizeof(line), stdin, "debug level? " );
                        ldap_debug = atoi( line );
+#ifdef LBER_DEBUG
                        if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
                                lber_debug = ldap_debug;
                        }
+#endif
 #else
                        printf( "Compile with -DLDAP_DEBUG for debugging\n" );
 #endif