From 25b98b34c55aff2590e5a8926c756e17818b840a Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 2 Apr 1998 00:25:47 +0000 Subject: [PATCH] (selection_data_to_lisp_data): Give make_string_from_bytes a correct char size. --- src/xselect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xselect.c b/src/xselect.c index 5eb7d432158..0a6978ec5c2 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1506,8 +1506,10 @@ selection_data_to_lisp_data (display, data, size, type, format) bufsize = decoding_buffer_size (&coding, size); buf = (unsigned char *) xmalloc (bufsize); decode_coding (&coding, data, buf, size, bufsize); - str = make_string_from_bytes ((char *) buf, - coding.produced_char, coding.produced); + size = (coding.fake_multibyte + ? multibyte_chars_in_text (buf, coding.produced) + : coding.produced_char); + str = make_string_from_bytes ((char *) buf, size, coding.produced); xfree (buf); } return str; -- 2.39.2