From e15e282807fd5d0e96f6d49099d2b6a20e6ab30d Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 29 May 2001 14:09:54 +0000 Subject: [PATCH] (Fsingle_key_description): NUL-terminate the string buffer before calling build_string. --- src/ChangeLog | 3 +++ src/keymap.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9c80466e787..a0c3c451e9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-05-29 Gerd Moellmann + * keymap.c (Fsingle_key_description): NUL-terminate the string + buffer before calling build_string. + * callproc.c (Fcall_process): Deal with decode_coding returning CODING_FINISH_INCONSISTENT_EOL. diff --git a/src/keymap.c b/src/keymap.c index f96c109c9cd..5da93ee89f0 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1967,7 +1967,10 @@ around function keys and event symbols.") nbytes = end - tem; nchars = multibyte_chars_in_text (tem, nbytes); if (nchars == nbytes) - string = build_string (tem); + { + *end = '\0'; + string = build_string (tem); + } else string = make_multibyte_string (tem, nchars, nbytes); return string; -- 2.39.5