Don't display any data if tdb_fetch() failed in the tdbtool "fetch"
authorTim Potter <tpot@samba.org>
Mon, 3 Dec 2001 04:15:26 +0000 (04:15 +0000)
committerTim Potter <tpot@samba.org>
Mon, 3 Dec 2001 04:15:26 +0000 (04:15 +0000)
command.
(This used to be commit a1cf70ab65058258e56ffcff5b28087b29425b1c)

source3/tdb/tdbtool.c

index 4198d12418960cff4e9cad812d3a8376a44ed5b3..31ecd17a0c100ce471e75d6b1133a40d497a6e2f 100644 (file)
@@ -253,7 +253,10 @@ static void show_tdb(void)
        key.dsize = strlen(k)+1;
 
        dbuf = tdb_fetch(tdb, key);
-       if (!dbuf.dptr) terror("fetch failed");
+       if (!dbuf.dptr) {
+               terror("fetch failed");
+               return;
+       }
        /* printf("%s : %*.*s\n", k, (int)dbuf.dsize, (int)dbuf.dsize, dbuf.dptr); */
        print_rec(tdb, key, dbuf, NULL);
 }