From 0090b4ee11a4cd24d21f20c292c44cfdd1b78f85 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Jun 2000 02:29:45 +0000 Subject: added some debug code to track down pack/unpack problems (This used to be commit ac9cdab33cddcc5ab00fc21ba79f416f5a9687e7) --- source3/tdb/tdbutil.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/tdb') diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index b253d5044a..5675061b37 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -105,6 +105,8 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) int len; char *s; char *buf0 = buf; + char *fmt0 = fmt; + int bufsize0 = bufsize; va_list ap; char c; @@ -162,6 +164,10 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) } va_end(ap); + + DEBUG(8,("tdb_pack(%s, %d) -> %d\n", + fmt0, bufsize0, (int)PTR_DIFF(buf, buf0))); + return PTR_DIFF(buf, buf0); } @@ -178,6 +184,8 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...) void **p; char *s, **b; char *buf0 = buf; + char *fmt0 = fmt; + int bufsize0 = bufsize; va_list ap; char c; @@ -233,6 +241,10 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...) } va_end(ap); + + DEBUG(8,("tdb_unpack(%s, %d) -> %d\n", + fmt0, bufsize0, (int)PTR_DIFF(buf, buf0))); + return PTR_DIFF(buf, buf0); no_space: -- cgit