fix: bug (it overlaps backwards, moving items >:(, why buggy copy sometimes?)

This commit is contained in:
javalsai 2024-07-25 02:03:17 +02:00
parent 468ebf769e
commit 483445007b
Signed by: javalsai
SSH Key Fingerprint: SHA256:3G83yKhBUWVABVX/vPWH88xnK4+ptMtHkZGCRXD4Mk8

View File

@ -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)--;