From 9c08ab9af00fa0df6a9344056b9b3489e0a8f558 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sun, 14 May 2023 23:23:29 +0100 Subject: [PATCH] Fix keyboard buffer handling (pointer moment) --- applications/services/gui/modules/text_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/services/gui/modules/text_input.c b/applications/services/gui/modules/text_input.c index 68f239809..cd0a9ee55 100644 --- a/applications/services/gui/modules/text_input.c +++ b/applications/services/gui/modules/text_input.c @@ -246,7 +246,7 @@ static void text_input_backspace_cb(TextInputModel* model) { model->cursor_pos = 0; } else if(model->cursor_pos > 0) { char* move = model->text_buffer + model->cursor_pos; - memmove(move, move + 1, strlen(move)); + memmove(move - 1, move, strlen(move) + 1); model->cursor_pos--; } } @@ -472,7 +472,7 @@ static void text_input_handle_ok(TextInput* text_input, TextInputModel* model, I model->cursor_pos = 1; } else { char* move = model->text_buffer + model->cursor_pos; - memmove(move + 1, move, strlen(move)); + memmove(move + 1, move, strlen(move) + 1); model->text_buffer[model->cursor_pos] = selected; model->cursor_pos++; }