summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/w32select.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/w32select.c b/src/w32select.c
index 0c8849c7be6..20f7cfc457f 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -130,6 +130,8 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
BLOCK_INPUT;
+ /* Include the terminating NULL character in the source of
+ conversion. */
nbytes = SBYTES (string) + 1;
src = SDATA (string);
dst = src;
@@ -208,7 +210,9 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
{
string = run_pre_post_conversion_on_str (string, &coding, 1);
src = SDATA (string);
- nbytes = SBYTES (string);
+ /* Include the terminating NULL character in the source of
+ conversion. */
+ nbytes = SBYTES (string) + 1;
}
coding.src_multibyte = 1;
coding.dst_multibyte = 0;