From 4a81cfac9c5b279e7ccfb99ec84bc6ebbe0c7320 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 30 Jan 2026 09:02:56 +0100 Subject: Wayland paste and DnD: fix minor issue revealed by valgrind - cont'd. --- src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/drivers/Wayland') diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index a2a5fdb52..3e45126b6 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -432,14 +432,12 @@ static void get_clipboard_or_dragged_text(struct wl_data_offer *offer) { from = fl_selection_buffer[1]; while (rest > 0) { ssize_t n = read(fds[0], from, rest); - if (n <= 0) { - close(fds[0]); - break; - } + if (n <= 0) break; n = Fl_Screen_Driver::convert_crlf(from, n); from += n; rest -= n; } + close(fds[0]); fl_selection_length[1] = from - fl_selection_buffer[1]; fl_selection_buffer[1][fl_selection_length[1]] = 0; way_out: -- cgit v1.2.3