diff options
author | James Booth <boothj5@gmail.com> | 2012-07-08 02:56:14 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-07-08 02:56:14 +0100 |
commit | 82d7a1d2736e3c1f71c92d1eba9e8a0b4b56f3de (patch) | |
tree | 791bb313a6195e48320a693cdec4c0abb8449f09 | |
parent | 2d8c21b3ec82dd7309300bdc0bb3e5e82146b376 (diff) | |
download | profani-tty-82d7a1d2736e3c1f71c92d1eba9e8a0b4b56f3de.tar.gz |
DEL key
-rw-r--r-- | input_win.c | 6 |
1 files 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)--; |