]> git.sur5r.net Git - openldap/commitdiff
Fix get/set error string bugs.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 23 Dec 1998 00:42:38 +0000 (00:42 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 23 Dec 1998 00:42:38 +0000 (00:42 +0000)
libraries/libldap/options.c

index b1c2fb66b67a01c13233cfbbd681379e89144608..0fd9ef5c70ce506c4450c2da43f3be73ef85d83d 100644 (file)
@@ -142,6 +142,9 @@ ldap_get_option(
                return 0;
 
        case LDAP_OPT_SERVER_CONTROLS:
+               /* not yet supported */
+               break;
+
        case LDAP_OPT_CLIENT_CONTROLS:
                /* not yet supported */
                break;
@@ -165,7 +168,6 @@ ldap_get_option(
                return 0;
 
        case LDAP_OPT_ERROR_STRING:
-               /* not yet supported */
                if(ld == NULL) {
                        /* bad param */
                        break;
@@ -181,7 +183,7 @@ ldap_get_option(
                } else {
                        * (char **) outvalue = ldap_strdup(ld->ld_error);
                }
-               break;
+               return 0;
 
        case LDAP_OPT_API_FEATURE_INFO: {
                        LDAPAPIFeatureInfo *info = (LDAPAPIFeatureInfo *) outvalue;
@@ -202,7 +204,7 @@ ldap_get_option(
 
        case LDAP_OPT_DEBUG_LEVEL:
                * (int *) outvalue = lo->ldo_debug;
-               break;
+               return 0;
 
        default:
                /* bad param */
@@ -278,13 +280,16 @@ ldap_set_option(
                        ld->ld_version = vers;
                } return 0;
 
-       case LDAP_OPT_SERVER_CONTROLS:
-       case LDAP_OPT_CLIENT_CONTROLS:
-               /* not yet supported */
-               break;
+       case LDAP_OPT_SERVER_CONTROLS: {
+                       /* not yet supported */
+               } break;
+
+       case LDAP_OPT_CLIENT_CONTROLS: {
+                       /* not yet supported */
+               } break;
 
        case LDAP_OPT_HOST_NAME: {
-                       char* host = * (char **) invalue;
+                       char* host = (char *) invalue;
 
                        if(lo->ldo_defhost != NULL) {
                                free(lo->ldo_defhost);
@@ -325,7 +330,7 @@ ldap_set_option(
                } return 0;
 
        case LDAP_OPT_ERROR_STRING: {
-                       char* err = * (char **) invalue;
+                       char* err = (char *) invalue;
 
                        if(ld == NULL) {
                                /* need a struct ldap */