]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/test.c
Remove LDAP_PORT dependencies so that ldap.conf defaults take over.
[openldap] / libraries / libldap / test.c
index d37556a5cfb2a82d0f5a869d3f4133bd64afe359..ad50e483ca3b1a19a7a8b47bfef8d84f597e4a3f 100644 (file)
@@ -8,7 +8,6 @@
 #include <ac/string.h>
 #include <ac/time.h>
 #include <ac/unistd.h>
-extern char *strdup (const char *);
 
 #include <sys/stat.h>
 
@@ -79,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 );
@@ -173,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 );
 
@@ -278,9 +277,6 @@ main( int argc, char **argv )
        int             copyoptions = 0;
        LDAPURLDesc     *ludp;
 
-       extern char     *optarg;
-       extern int      optind;
-
        host = NULL;
        port = LDAP_PORT;
        dnsuffix = "";
@@ -320,12 +316,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;