commit d7e3226158f083e1b57f9b5e0ab2f09fb3d21fef
parent 74c6bdac9f7a49973847c1a49cf864c8e4092b7f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 10 Jun 2021 11:34:04 +0200
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/prompt.c b/src/prompt.c
@@ -426,7 +426,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 {