# HG changeset patch # User Kenichi Handa # Date 1088638239 0 # Node ID 1a3e49df7b8d8d9be7c03c51a2adfe2dc65a27a9 # Parent 31fffb8693e485cb97cf906c1b0d8729ed9865e6 (Fw32_set_clipboard_data): Update `nbytes' correctly after getting a new string by pre-write-conversion. diff -r 31fffb8693e4 -r 1a3e49df7b8d src/w32select.c --- 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;