Merge pull request #5001 from akallabeth/mac_clipboard_fix

Fixed #4995: Don't forget to send the NULL of the clipboard string.
This commit is contained in:
Bernhard Miklautz 2018-11-14 11:39:23 +00:00 committed by GitHub
commit 44ead4cfef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -769,7 +769,8 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
formatId = ClipboardRegisterFormat(mfc->clipboard, "UTF8_STRING");
size = (UINT32) [formatData length];
data = [formatData bytes];
ClipboardSetData(mfc->clipboard, formatId, data, size);
/* size is the string length without the terminating NULL terminator */
ClipboardSetData(mfc->clipboard, formatId, data, size + 1);
formatMatch = TRUE;
break;
}