tdb: fix logging of offets and lengths.
[samba.git] / lib / tdb / common / dump.c
index f4682fa2894ed788c1ff568d8603bbf4aadec907..7193c1e110e7fe1533bdf3abf69484b17757758e 100644 (file)
@@ -39,8 +39,8 @@ static tdb_off_t tdb_dump_record(struct tdb_context *tdb, int hash,
                return 0;
        }
 
-       printf(" rec: hash=%d offset=0x%08x next=0x%08x rec_len=%d "
-              "key_len=%d data_len=%d full_hash=0x%x magic=0x%x\n",
+       printf(" rec: hash=%d offset=0x%08x next=0x%08x rec_len=%u "
+              "key_len=%u data_len=%u full_hash=0x%x magic=0x%x\n",
               hash, offset, rec.next, rec.rec_len, rec.key_len, rec.data_len,
               rec.full_hash, rec.magic);
 
@@ -122,15 +122,14 @@ _PUBLIC_ int tdb_printfreelist(struct tdb_context *tdb)
                        return -1;
                }
 
-               printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%d)] (end = 0x%08x)\n",
+               printf("entry offset=[0x%08x], rec.rec_len = [0x%08x (%u)] (end = 0x%08x)\n",
                       rec_ptr, rec.rec_len, rec.rec_len, rec_ptr + rec.rec_len);
                total_free += rec.rec_len;
 
                /* move to the next record */
                rec_ptr = rec.next;
        }
-       printf("total rec_len = [0x%08x (%d)]\n", (int)total_free,
-               (int)total_free);
+       printf("total rec_len = [0x%08lx (%lu)]\n", total_free, total_free);
 
        return tdb_unlock(tdb, -1, F_WRLCK);
 }