0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1039: cannot put NUL byte on clipboard

Problem:    Cannot put NUL byte on clipboard.
Solution:   Use the text length. (Christian Brabandt, closes #6312,
            closes #6149)
This commit is contained in:
Bram Moolenaar
2020-06-22 20:30:27 +02:00
parent b2b218d89b
commit 25fd267287
3 changed files with 22 additions and 2 deletions

View File

@@ -422,7 +422,7 @@ clip_mch_request_selection(Clipboard_T *cbd)
}
}
if (str != NULL && *str != NUL)
if (str != NULL && metadata.txtlen != 0)
{
char_u *temp_clipboard;
@@ -543,7 +543,7 @@ clip_mch_set_selection(Clipboard_T *cbd)
if (lpszMem)
{
vim_strncpy((char_u *)lpszMem, str, metadata.txtlen);
mch_memmove((char_u *)lpszMem, str, metadata.txtlen);
GlobalUnlock(hMem);
}
}