summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-04 02:29:45 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-04 02:29:45 +0000
commit0090b4ee11a4cd24d21f20c292c44cfdd1b78f85 (patch)
tree6b86a71d9807f449ddcfe5d0321666f1b2648dd9 /source3
parentad267718ddaec0b1fc1588f180f11500c7f31d69 (diff)
downloadsamba-0090b4ee11a4cd24d21f20c292c44cfdd1b78f85.tar.gz
samba-0090b4ee11a4cd24d21f20c292c44cfdd1b78f85.tar.bz2
samba-0090b4ee11a4cd24d21f20c292c44cfdd1b78f85.zip
added some debug code to track down pack/unpack problems
(This used to be commit ac9cdab33cddcc5ab00fc21ba79f416f5a9687e7)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdbutil.c12
1 files changed, 12 insertions, 0 deletions
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: