summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-06-27 08:23:26 +0200
committerMichael Adam <obnox@samba.org>2008-06-27 12:46:11 +0200
commitbcc6a3786c30a76ac80529cc60f4958dfed9abc6 (patch)
tree50a52dc6fa4d5af3c7e69e584fef06a872c19f8c /source4/lib
parent3678411037329d8bebcaadcea6676018e0131afb (diff)
downloadsamba-bcc6a3786c30a76ac80529cc60f4958dfed9abc6.tar.gz
samba-bcc6a3786c30a76ac80529cc60f4958dfed9abc6.tar.bz2
samba-bcc6a3786c30a76ac80529cc60f4958dfed9abc6.zip
tdb_unpack: Eliminate "cast to pointer from integer of different size" warning on 64bit.
The 'p' type is just a flag to mark the presence of a pointer, not a real pointer itself. The code is now the same as in Samba3's tdb_unpack. Michael (This used to be commit a516bc9a2d4ce86244d0e2fbfacf6fda5e12e987)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/util/util_tdb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/util/util_tdb.c b/source4/lib/util/util_tdb.c
index 77ad4eb617..e4219dfd69 100644
--- a/source4/lib/util/util_tdb.c
+++ b/source4/lib/util/util_tdb.c
@@ -482,7 +482,13 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
p = va_arg(ap, void **);
if (bufsize < len)
goto no_space;
- *p = (void *)IVAL(buf, 0);
+
+ /*
+ * This isn't a real pointer - only a token (1 or 0)
+ * to mark the fact a pointer is present.
+ */
+
+ *p = (void *)(IVAL(buf, 0) ? (void *)1 : NULL);
break;
case 'P':
/* Return a malloc'ed string. */