]> git.sur5r.net Git - openldap/commitdiff
fix use of uninitialized value; beautify logs
authorPierangelo Masarati <ando@openldap.org>
Sun, 7 Aug 2005 10:49:40 +0000 (10:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 7 Aug 2005 10:49:40 +0000 (10:49 +0000)
servers/slapd/back-sql/add.c
servers/slapd/back-sql/delete.c

index 9a6e6a56f9ff51be5879b2250d788e1dfd12e97d..03fb03f5bdb1dce06c3724e3910dadc406d4aad1 100644 (file)
@@ -131,7 +131,7 @@ backsql_modify_delete_all_values(
        {
                int             i;
                /* first parameter no, parameter order */
-               SQLUSMALLINT    pno,
+               SQLUSMALLINT    pno = 0,
                                po = 0;
                /* procedure return code */
                int             prc = LDAP_SUCCESS;
@@ -193,12 +193,12 @@ backsql_modify_delete_all_values(
 #ifdef BACKSQL_ARBITRARY_KEY
                        Debug( LDAP_DEBUG_TRACE,
                                "   backsql_modify_delete_all_values() "
-                               "arg%d=%s\n",
+                               "arg(%d)=%s\n",
                                pno + 1 + po, e_id->eid_keyval.bv_val, 0 );
 #else /* ! BACKSQL_ARBITRARY_KEY */
                        Debug( LDAP_DEBUG_TRACE,
                                "   backsql_modify_delete_all_values() "
-                               "arg%d=%lu\n",
+                               "arg(%d)=%lu\n",
                                pno + 1 + po, e_id->eid_keyval, 0 );
 #endif /* ! BACKSQL_ARBITRARY_KEY */
 
@@ -225,7 +225,7 @@ backsql_modify_delete_all_values(
         
                        Debug( LDAP_DEBUG_TRACE, 
                                "   backsql_modify_delete_all_values(): "
-                               "arg%d=%s; executing \"%s\"\n",
+                               "arg(%d)=%s; executing \"%s\"\n",
                                pno + 2 - po, row.cols[ i ],
                                at->bam_delete_proc );
                        rc = SQLExecute( sth );
@@ -480,12 +480,12 @@ add_only:;
 #ifdef BACKSQL_ARBITRARY_KEY
                                Debug( LDAP_DEBUG_TRACE,
                                        "   backsql_modify_internal(): "
-                                       "arg%d=\"%s\"\n", 
+                                       "arg(%d)=\"%s\"\n", 
                                        pno + 1 + po, e_id->eid_keyval.bv_val, 0 );
 #else /* ! BACKSQL_ARBITRARY_KEY */
                                Debug( LDAP_DEBUG_TRACE,
                                        "   backsql_modify_internal(): "
-                                       "arg%d=\"%lu\"\n", 
+                                       "arg(%d)=\"%lu\"\n", 
                                        pno + 1 + po, e_id->eid_keyval, 0 );
 #endif /* ! BACKSQL_ARBITRARY_KEY */
 
@@ -510,7 +510,7 @@ add_only:;
                                }
                                Debug( LDAP_DEBUG_TRACE,
                                        "   backsql_modify_internal(): "
-                                       "arg%d=\"%s\"; executing \"%s\"\n", 
+                                       "arg(%d)=\"%s\"; executing \"%s\"\n", 
                                        pno + 2 - po, at_val->bv_val,
                                        at->bam_add_proc );
 
@@ -643,12 +643,12 @@ add_only:;
 #ifdef BACKSQL_ARBITRARY_KEY
                                Debug( LDAP_DEBUG_TRACE,
                                        "   backsql_modify_internal(): "
-                                       "arg%d=\"%s\"\n", 
+                                       "arg(%d)=\"%s\"\n", 
                                        pno + 1 + po, e_id->eid_keyval.bv_val, 0 );
 #else /* ! BACKSQL_ARBITRARY_KEY */
                                Debug( LDAP_DEBUG_TRACE,
                                        "   backsql_modify_internal(): "
-                                       "arg%d=\"%lu\"\n", 
+                                       "arg(%d)=\"%lu\"\n", 
                                        pno + 1 + po, e_id->eid_keyval, 0 );
 #endif /* ! BACKSQL_ARBITRARY_KEY */
 
index d0d1ad064f1bf6ed4a909c390f9b7917a689189a..d58442787e5148617ad9dc0d0958e6b046a4e42b 100644 (file)
@@ -93,7 +93,7 @@ backsql_delete( Operation *op, SlapReply *rs )
        struct berval           pdn = BER_BVNULL;
        int                     manageDSAit = get_manageDSAit( op );
        /* first parameter no */
-       SQLUSMALLINT            pno;
+       SQLUSMALLINT            pno = 0;
 
        Debug( LDAP_DEBUG_TRACE, "==>backsql_delete(): deleting entry \"%s\"\n",
                        op->o_req_ndn.bv_val, 0, 0 );
@@ -287,9 +287,6 @@ backsql_delete( Operation *op, SlapReply *rs )
                        e = NULL;
                        goto done;
                }
-
-       } else {
-               pno = 0;
        }
 
        rc = backsql_BindParamID( sth, pno + 1, SQL_PARAM_INPUT, &e_id.eid_keyval );