From f35daa7d3b448692966244a6d7931118ee0e8263 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 10 Jun 2021 11:34:04 +0200 Subject: [PATCH 14/14] memory: move the correct number of bytes, and not one too many We want to reduce the size of the answer by one byte, not keep the full answer (plus terminating NUL). This fixes https://savannah.gnu.org/bugs/?60764. Bug existed since version 2.9.8, commit f304b9ae, since piping text to an external command was introduced. --- src/prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index d092c707..180da860 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -424,7 +424,7 @@ void draw_the_promptbar(void) void add_or_remove_pipe_symbol_from_answer(void) { if (answer[0] == '|') { - memmove(answer, answer + 1, strlen(answer) + 1); + memmove(answer, answer + 1, strlen(answer)); if (typing_x > 0) typing_x--; } else { -- 2.29.3