Wayland: Fix partial writes of clipboard string

The string pointer used to write the contents of our clipboard data
offer was never updated, causing it to repeat parts of the beginning of
the string until the correct number of bytes had been written.

(cherry picked from commit 4c110bba41)
This commit is contained in:
Camilla Löwy
2022-03-22 19:23:25 +01:00
parent 2430d6b7f7
commit 25db8f8014
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1725,7 +1725,7 @@ static void dataSourceHandleSend(void* data,
const char* mimeType,
int fd)
{
const char* string = _glfw.wl.clipboardSendString;
char* string = _glfw.wl.clipboardSendString;
size_t len = strlen(string);
int ret;
@@ -1765,6 +1765,7 @@ static void dataSourceHandleSend(void* data,
return;
}
len -= ret;
string += ret;
}
close(fd);
}