about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-07-08 02:52:46 +0100
committerJames Booth <boothj5@gmail.com>2012-07-08 02:52:46 +0100
commit2d8c21b3ec82dd7309300bdc0bb3e5e82146b376 (patch)
treea76831d93b54e4cd488b8b9a8ecebacc5f83b141
parent15a87f0abb3ddeee425e23f8ab99eaa01abaadfc (diff)
downloadprofani-tty-2d8c21b3ec82dd7309300bdc0bb3e5e82146b376.tar.gz
Delete in middle of input
-rw-r--r--input_win.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/input_win.c b/input_win.c
index 9da0506c..2094ff4d 100644
--- a/input_win.c
+++ b/input_win.c
@@ -196,8 +196,8 @@ static int _handle_edit(const int ch, char *input, int *size)
                 (*size)--;
 
             // if in middle, delete and shift chars left
-            } else if (inp_x > 1 && inp_x <= *size) {
-                for (i = inp_x-1; i < *size; i++)
+            } else if (inp_x > 0 && inp_x < *size) {
+                for (i = inp_x; i < *size; i++)
                     input[i-1] = input[i];
                 (*size)--;