mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
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:
parent
2430d6b7f7
commit
25db8f8014
@ -132,6 +132,7 @@ information on what to include when reporting a bug.
|
||||
- [Wayland] Bugfix: `glfwSetClipboardString` would fail if set to result of
|
||||
`glfwGetClipboardString`
|
||||
- [Wayland] Bugfix: Data source creation error would cause double free at termination
|
||||
- [Wayland] Bugfix: Partial writes of clipboard string would cause beginning to repeat
|
||||
|
||||
|
||||
## Contact
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user