Wayland paste and DnD: fix minor issue revealed by valgrind - cont'd.

This commit is contained in:
ManoloFLTK 2026-01-30 09:02:56 +01:00
parent 4c5b1df4c8
commit 4a81cfac9c

View File

@ -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: