summaryrefslogtreecommitdiff
path: root/src/w32select.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2004-06-30 23:30:39 +0000
committerKenichi Handa <handa@m17n.org>2004-06-30 23:30:39 +0000
commit4121d6122b9f3919bf1cc6433198ca9b14b4d67e (patch)
tree18fecf6d0060a3b204569641c82de9236b7127ee /src/w32select.c
parent07a6ab76c04dc9344ae1114c4acb7da5903825a0 (diff)
downloademacs-4121d6122b9f3919bf1cc6433198ca9b14b4d67e.tar.gz
(Fw32_set_clipboard_data): Update `nbytes' correctly
after getting a new string by pre-write-conversion.
Diffstat (limited to 'src/w32select.c')
-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;