summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-26 01:00:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:01 -0500
commite5613a3ce9932fb76aef9f721cadabe69bd23be8 (patch)
tree347ea4097ca88e1bbf09d17b3aca3bf251320826
parent72cc1a1f12d4a44e3993cd958cd6e51e8fc1d693 (diff)
downloadsamba-e5613a3ce9932fb76aef9f721cadabe69bd23be8.tar.gz
samba-e5613a3ce9932fb76aef9f721cadabe69bd23be8.tar.bz2
samba-e5613a3ce9932fb76aef9f721cadabe69bd23be8.zip
r6980: added data_blob_append(), which I use in the web server
(This used to be commit 822e2e5abeba8343e9e8165c14f4371c30cc13b1)
-rw-r--r--source4/lib/data_blob.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/data_blob.c b/source4/lib/data_blob.c
index 2ec21717b1..049210e8ee 100644
--- a/source4/lib/data_blob.c
+++ b/source4/lib/data_blob.c
@@ -180,3 +180,16 @@ DATA_BLOB data_blob_const(const void *p, size_t length)
blob.length = length;
return blob;
}
+
+
+/*
+ append some data to a data blob
+*/
+NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, void *p, size_t length)
+{
+ blob->data = talloc_realloc_size(mem_ctx, blob->data, blob->length + length);
+ NT_STATUS_HAVE_NO_MEMORY(blob->data);
+ memcpy(blob->data + blob->length, p, length);
+ blob->length += length;
+ return NT_STATUS_OK;
+}