]> git.sur5r.net Git - openldap/blobdiff - contrib/saucer/main.c
s/ldap_open/ldap_init/ calls... ldap_open is deprecated.
[openldap] / contrib / saucer / main.c
index e374e84a83b9bc95f78ebb3c4f77e4ea0077004f..d99d3e558dc3e807db6732171d82e3bd69a7dcee 100644 (file)
@@ -20,7 +20,8 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
 
 #ifdef HAVE_READLINE
 #  include <readline/readline.h>
@@ -448,7 +449,7 @@ void display_search_results(LDAPMessage *result)
        for (entry = ldap_first_entry(ld, result); entry; entry = ldap_next_entry(ld, entry)) {
                if (s = ldap_get_dn(ld, entry)) {
                        printf("  %s\n", s);
-                       free(s);
+                       ldap_memfree(s);
                }
 
                /* Make one pass to calculate the length of the longest attribute name */
@@ -613,7 +614,7 @@ int main(int argc, char **argv)
                case 'd':
 #ifdef LDAP_DEBUG
                        tmp = atoi(optarg);
-                       lber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &tmp);
+                       ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &tmp);
                        ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &tmp);
 #endif
                        break;
@@ -638,8 +639,8 @@ int main(int argc, char **argv)
 
        rc = user_tailor();
 
-       if (!(ld = ldap_open(hostname, portnum))) {
-               fprintf(stderr, "%s: unable to connect to server at host `%s' on port %d\n",
+       if (!(ld = ldap_init(hostname, portnum))) {
+               fprintf(stderr, "%s: unable to initialize LDAP session (%s:%d)\n",
                                progname, hostname, portnum);
                exit(2);
        }