aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2024-03-16 20:28:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-03-17 11:31:02 +0000
commite8b04e0e2c9e8a4f825193b907d04c3b3165a842 (patch)
treee09c19881361236101249e846d7ac8618ca4baab /terminal.c
parentmain/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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/terminal.c b/terminal.c
index 3cf44d5a..e4396585 100644
--- a/terminal.c
+++ b/terminal.c
@@ -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,
};