From 822e2e5abeba8343e9e8165c14f4371c30cc13b1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 May 2005 01:00:58 +0000 Subject: [PATCH] r6980: added data_blob_append(), which I use in the web server --- source/lib/data_blob.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/lib/data_blob.c b/source/lib/data_blob.c index 2ec21717b13..049210e8eee 100644 --- a/source/lib/data_blob.c +++ b/source/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; +}