diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2024-03-16 20:28:10 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-03-17 11:31:02 +0000 |
| commit | e8b04e0e2c9e8a4f825193b907d04c3b3165a842 (patch) | |
| tree | e09c19881361236101249e846d7ac8618ca4baab /terminal.c | |
| parent | main/config: replace some uses of xasprintf() with xstrjoin() (diff) | |
xmalloc: add xmemdup() and use to replace some uses of xmalloc+memcpy
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 5 |
1 files changed, 1 insertions, 4 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, }; |
