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.
master
Benno Schulenberg 2021-06-10 11:34:04 +02:00
parent 74c6bdac9f
commit d7e3226158
1 changed files with 1 additions and 1 deletions

View File

@ -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 {