]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fw32_set_clipboard_data): Update `nbytes' correctly
authorKenichi Handa <handa@m17n.org>
Wed, 30 Jun 2004 23:30:39 +0000 (23:30 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 30 Jun 2004 23:30:39 +0000 (23:30 +0000)
after getting a new string by pre-write-conversion.

src/w32select.c

index 0c8849c7be6fe35a2b7cf64f55a4f4b4b813333b..20f7cfc457fc6343735c1ad258e34a1049ba6322 100644 (file)
@@ -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;