summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-15 14:07:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:38 -0500
commit03e3cd1d5a005ad5fd2bc97f9863abf675efd09f (patch)
tree183a66f7bb43c7a34f05511a1903a854d963e27d /source3/tdb
parent81e501ad1587b4f75851bc39c826383b112b7cb3 (diff)
downloadsamba-03e3cd1d5a005ad5fd2bc97f9863abf675efd09f.tar.gz
samba-03e3cd1d5a005ad5fd2bc97f9863abf675efd09f.tar.bz2
samba-03e3cd1d5a005ad5fd2bc97f9863abf675efd09f.zip
r17554: Cleanup
(This used to be commit 761cbd52f0cff6b864c506ec03c94039b6101ef9)
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdbutil.c12
-rw-r--r--source3/tdb/tdbutil.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 21d593a26a..b946f856aa 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -505,10 +505,9 @@ size_t tdb_pack(char *buf, int bufsize, const char *fmt, ...)
return result;
}
-BOOL tdb_pack_append(void *_mem_ctx, char **buf, size_t *len,
+BOOL tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
const char *fmt, ...)
{
- TALLOC_CTX *mem_ctx = (void *)_mem_ctx;
va_list ap;
size_t len1, len2;
@@ -516,8 +515,13 @@ BOOL tdb_pack_append(void *_mem_ctx, char **buf, size_t *len,
len1 = tdb_pack_va(NULL, 0, fmt, ap);
va_end(ap);
- *buf = TALLOC_REALLOC_ARRAY(mem_ctx, *buf, char,
- (*len) + len1);
+ if (mem_ctx != NULL) {
+ *buf = TALLOC_REALLOC_ARRAY(mem_ctx, *buf, uint8,
+ (*len) + len1);
+ } else {
+ *buf = SMB_REALLOC_ARRAY(*buf, uint8, (*len) + len1);
+ }
+
if (*buf == NULL) {
return False;
}
diff --git a/source3/tdb/tdbutil.h b/source3/tdb/tdbutil.h
index 60107adacb..44351619f4 100644
--- a/source3/tdb/tdbutil.h
+++ b/source3/tdb/tdbutil.h
@@ -54,8 +54,6 @@ struct tdb_context *tdb_open_log(const char *name, int hash_size,
int tdb_flags, int open_flags, mode_t mode);
int tdb_unpack(char *buf, int bufsize, const char *fmt, ...);
size_t tdb_pack(char *buf, int bufsize, const char *fmt, ...);
-BOOL tdb_pack_append(void *_mem_ctx, char **buf, size_t *len,
- const char *fmt, ...);
TDB_DATA make_tdb_data(const char *dptr, size_t dsize);
TDB_DATA string_tdb_data(const char *string);
int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,