From be355833a0fb77e69311829d3eb837292189abf6 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 7 Aug 2005 10:49:40 +0000 Subject: [PATCH] fix use of uninitialized value; beautify logs --- servers/slapd/back-sql/add.c | 18 +++++++++--------- servers/slapd/back-sql/delete.c | 5 +---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 9a6e6a56f9..03fb03f5bd 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -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 */ diff --git a/servers/slapd/back-sql/delete.c b/servers/slapd/back-sql/delete.c index d0d1ad064f..d58442787e 100644 --- a/servers/slapd/back-sql/delete.c +++ b/servers/slapd/back-sql/delete.c @@ -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 ); -- 2.39.5