diff options
-rw-r--r-- | libbb/lineedit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index a3d939551..9a773b4b8 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -429,7 +429,9 @@ static void input_delete(int save) | |||
429 | #endif | 429 | #endif |
430 | 430 | ||
431 | memmove(command_ps + j, command_ps + j + 1, | 431 | memmove(command_ps + j, command_ps + j + 1, |
432 | (command_len - j + 1) * sizeof(command_ps[0])); | 432 | /* (command_len + 1 [because of NUL]) - (j + 1) |
433 | * simplified into (command_len - j) */ | ||
434 | (command_len - j) * sizeof(command_ps[0])); | ||
433 | command_len--; | 435 | command_len--; |
434 | input_end(); /* rewrite new line */ | 436 | input_end(); /* rewrite new line */ |
435 | cmdedit_set_out_char(' '); /* erase char */ | 437 | cmdedit_set_out_char(' '); /* erase char */ |