From 483445007b55c591c31fcaafea46d7bf4daa73f5 Mon Sep 17 00:00:00 2001 From: javalsai Date: Thu, 25 Jul 2024 02:03:17 +0200 Subject: [PATCH] fix: bug (it overlaps backwards, moving items >:(, why buggy copy sometimes?) --- src/efield.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/efield.c b/src/efield.c index a5d7912..12f7bcf 100644 --- a/src/efield.c +++ b/src/efield.c @@ -32,7 +32,7 @@ void field_update(struct editable_field *field, char *update) { if (*update == 127) { if (field->pos == 0) return; if (field->pos < field->length) { - memcpy(&field->content[field->pos - 1], &field->content[field->pos], + memmove(&field->content[field->pos - 1], &field->content[field->pos], field->length - field->pos); } (field->pos)--;