aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--noice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/noice.c b/noice.c
index e4f86a0..638211d 100644
--- a/noice.c
+++ b/noice.c
@@ -366,9 +366,9 @@ readln(void)
if (c == KEY_BACKSPACE) {
getyx(stdscr, y, x);
if (x >= x0) {
+ i--;
if (i > 0) {
- ln = xrealloc(ln, (i - 1) * sizeof(*ln));
- i--;
+ ln = xrealloc(ln, i * sizeof(*ln));
} else {
free(ln);
ln = NULL;