r442: fixed some uninitialised variables pointed out by gcc -O3
authorAndrew Tridgell <tridge@samba.org>
Sun, 2 May 2004 05:16:15 +0000 (05:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:42 +0000 (12:51 -0500)
(This used to be commit ff31cfb941b77e99e648011a6b7639b2a5923a6a)

source4/lib/ldb/common/util.c
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/tools/ldbmodify.c

index e1a7ada1c6578126abbad16edbba0a4a1477b9d4..534d07c1df31056e761d5693630ffa090305d695 100644 (file)
@@ -73,14 +73,13 @@ int list_find(const void *needle,
        max_i = nmemb-1;
 
        while (min_i < max_i) {
-               size_t test_t;
                int r;
 
                test_i = (min_i + max_i) / 2;
                r = comp_fn(needle, *(void * const *)(base_p + (size * test_i)));
                if (r == 0) {
                        /* scan back for first element */
-                       while (test_t > 0 &&
+                       while (test_i > 0 &&
                               comp_fn(needle, *(void * const *)(base_p + (size * (test_i-1)))) == 0) {
                                test_i--;
                        }
index 76e17cdfd533059cc62e9c465380dab9ff732e42..987ee017b6986d11653c597c40dcd5e5c43579c6 100644 (file)
@@ -452,7 +452,7 @@ static int ltdb_index_dn(struct ldb_context *ldb,
                         const struct ldb_message *index_list,
                         struct dn_list *list)
 {
-       int ret;
+       int ret = -1;
 
        switch (tree->operation) {
        case LDB_OP_SIMPLE:
index ac32f90c3bc2bfde01d5e3db60fadba2a12da762..bc29369a5c1a7fcbb532c7e91e6c41c432a63c37 100644 (file)
@@ -52,7 +52,7 @@ static void usage(void)
 static int process_file(struct ldb_context *ldb, FILE *f)
 {
        struct ldb_ldif *ldif;
-       int ret, count = 0;
+       int ret = -1, count = 0;
        
        while ((ldif = ldif_read_file(f))) {
                switch (ldif->changetype) {