From fee2aedc374f7eb3acd6e3b4d31a4c332e5756bf Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 29 Oct 2001 09:44:31 +0000 Subject: [PATCH] (XTread_socket) : Don't use STRING_CHAR_AND_LENGTH if nchars == nbytes. From Kenichi Handa . --- src/xterm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 1ea8a801fbf..3944556d57a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10593,8 +10593,12 @@ XTread_socket (sd, bufp, numchars, expected) character events. */ for (i = 0; i < nbytes; i += len) { - c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, - nbytes - i, len); + if (nchars == nbytes) + c = copy_bufptr[i], len = 1; + else + c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, + nbytes - i, len); + bufp->kind = (SINGLE_BYTE_CHAR_P (c) ? ascii_keystroke : multibyte_char_keystroke); -- 2.39.2