From 91a839bf8ee146e6c43152f701431a77fa34b940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 22 Aug 2020 09:25:25 +0200 Subject: [PATCH] term: enqueue data: cleanup --- terminal.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/terminal.c b/terminal.c index 08ef11c2..9d68167d 100644 --- a/terminal.c +++ b/terminal.c @@ -54,21 +54,15 @@ static void enqueue_data_for_slave(const void *data, size_t len, size_t offset, ptmx_buffer_list_t *buffer_list) { - /* - * We're in asynchronous mode - push data to queue and let the FDM - * handler take care of it - */ - { - void *copy = xmalloc(len); - memcpy(copy, data, len); + void *copy = xmalloc(len); + memcpy(copy, data, len); - struct ptmx_buffer queued = { - .data = copy, - .len = len, - .idx = offset, - }; - tll_push_back(*buffer_list, queued); - } + struct ptmx_buffer queued = { + .data = copy, + .len = len, + .idx = offset, + }; + tll_push_back(*buffer_list, queued); } static bool