mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
xmalloc: add xmemdup() and use to replace some uses of xmalloc+memcpy
This commit is contained in:
parent
853be450bb
commit
e8b04e0e2c
4 changed files with 14 additions and 18 deletions
|
|
@ -51,11 +51,8 @@ static void
|
|||
enqueue_data_for_slave(const void *data, size_t len, size_t offset,
|
||||
ptmx_buffer_list_t *buffer_list)
|
||||
{
|
||||
void *copy = xmalloc(len);
|
||||
memcpy(copy, data, len);
|
||||
|
||||
struct ptmx_buffer queued = {
|
||||
.data = copy,
|
||||
.data = xmemdup(data, len),
|
||||
.len = len,
|
||||
.idx = offset,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue