From 82d7a1d2736e3c1f71c92d1eba9e8a0b4b56f3de Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 8 Jul 2012 02:56:14 +0100 Subject: [PATCH] DEL key --- input_win.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input_win.c b/input_win.c index 2094ff4d..6fe7a3f8 100644 --- a/input_win.c +++ b/input_win.c @@ -210,12 +210,12 @@ static int _handle_edit(const int ch, char *input, int *size) return 1; case KEY_DC: // DEL - if (inp_x <= *size) { + if (inp_x < *size) { wdelch(inp_win); // if not last char, shift chars left - if (inp_x < *size) - for (i = inp_x-1; i < *size; i++) + if (inp_x < *size - 1) + for (i = inp_x; i < *size; i++) input[i] = input[i+1]; (*size)--;