diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2026-01-30 08:33:16 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2026-01-30 08:33:16 +0100 |
| commit | 6678458b41cc3d6a9dfc50ab5baaf7e93488378f (patch) | |
| tree | 3038eb7d414f75db09ee120e258f0c80999a6726 /src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | |
| parent | e9966b7e3190705b3e9b50d35f6a5aff3fe6443e (diff) | |
Wayland paste and DnD: fix minor issue revealed by valgrind.
Diffstat (limited to 'src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx')
| -rw-r--r-- | src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index 333cafd5f..a2a5fdb52 100644 --- a/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -430,7 +430,7 @@ static void get_clipboard_or_dragged_text(struct wl_data_offer *offer) { fl_selection_buffer_length[1] = rest+1000; } from = fl_selection_buffer[1]; - while (true) { + while (rest > 0) { ssize_t n = read(fds[0], from, rest); if (n <= 0) { close(fds[0]); @@ -438,6 +438,7 @@ static void get_clipboard_or_dragged_text(struct wl_data_offer *offer) { } n = Fl_Screen_Driver::convert_crlf(from, n); from += n; + rest -= n; } fl_selection_length[1] = from - fl_selection_buffer[1]; fl_selection_buffer[1][fl_selection_length[1]] = 0; |
