diff src/w32select.c @ 56299:1a3e49df7b8d

(Fw32_set_clipboard_data): Update `nbytes' correctly after getting a new string by pre-write-conversion.
author Kenichi Handa <handa@m17n.org>
date Wed, 30 Jun 2004 23:30:39 +0000
parents 64d01f3f16e5
children 04686828d0da 6f6e9fe4658b
line wrap: on
line diff
--- a/src/w32select.c	Wed Jun 30 19:36:36 2004 +0000
+++ b/src/w32select.c	Wed Jun 30 23:30:39 2004 +0000
@@ -130,6 +130,8 @@
 
   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 @@
 	  {
 	    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;