From 94c5e361fbb229b0cd6853e2102a7d95f1f358b3 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 22:12:02 +0300 Subject: better public interface and doxygen --- src/wayland/clipboard.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/wayland/clipboard.c') diff --git a/src/wayland/clipboard.c b/src/wayland/clipboard.c index e3eec0f..a6922c4 100644 --- a/src/wayland/clipboard.c +++ b/src/wayland/clipboard.c @@ -131,9 +131,11 @@ static int transfer_io(int fd, short events, void *ud) if (n > 0) { t->len += (size_t)n; } else if (n == 0) { - t->owner->receive(t->text ? t->text : "", t->len, t->uri_list, - t->drop_surface, t->owner->ud); - transfer_end(t, true); + bool valid = yasl_utf8_validate(t->text, t->len); + if (valid) + t->owner->receive(t->text ? t->text : "", t->len, t->uri_list, + t->drop_surface, t->owner->ud); + transfer_end(t, valid); } else if (errno != EAGAIN && errno != EINTR) transfer_destroy(t); } return 0; -- cgit v1.2.3