diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-05-28 16:53:56 +0930 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-05-28 11:22:14 +0200 |
commit | 3bd686c5ad4756af1033ac14ba09a40156cc6d47 (patch) | |
tree | 55d7d61637fa477e542f2d8c291835be0f8a415c /lib/tdb/common/dump.c | |
parent | 5a633dd6bb5be817c6b421df0c098e3428a20773 (diff) | |
download | samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.tar.gz samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.tar.bz2 samba-3bd686c5ad4756af1033ac14ba09a40156cc6d47.zip |
tdb: fix logging of offets and lengths.
We can have offsets > 2G, so use unsigned values. Fixes other prints to be
native types rather than casts, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 28 11:22:14 CEST 2013 on sn-devel-104
Diffstat (limited to 'lib/tdb/common/dump.c')
-rw-r--r-- | lib/tdb/common/dump.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/tdb/common/dump.c b/lib/tdb/common/dump.c index f4682fa289..7193c1e110 100644 --- a/lib/tdb/common/dump.c +++ b/lib/tdb/common/dump.c @@ -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); } |