mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
r6980: added data_blob_append(), which I use in the web server
This commit is contained in:
parent
ec72d7d614
commit
822e2e5abe
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user