From: Kenichi Handa Date: Wed, 30 Jun 2004 23:30:39 +0000 (+0000) Subject: (Fw32_set_clipboard_data): Update `nbytes' correctly X-Git-Tag: ttn-vms-21-2-B4~5586 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4121d6122b9f3919bf1cc6433198ca9b14b4d67e;p=emacs.git (Fw32_set_clipboard_data): Update `nbytes' correctly after getting a new string by pre-write-conversion. --- 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;