From 9a07c734eb2e6e3907033f092ad002fb897e76fc Mon Sep 17 00:00:00 2001 From: ephphatha Date: Sun, 20 Mar 2022 20:43:05 +1100 Subject: [PATCH] Remove unnecessary copy Was this meant to reset the output? It should never be changed unless the user confirms input. In practice this was calling memcpy with the same src and dest pointers, which is undefined behaviour. --- Source/platform/ctr/keyboard.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Source/platform/ctr/keyboard.cpp b/Source/platform/ctr/keyboard.cpp index 421a830e1..087bbc65c 100644 --- a/Source/platform/ctr/keyboard.cpp +++ b/Source/platform/ctr/keyboard.cpp @@ -53,10 +53,7 @@ void ctr_vkbdFlush() if (button == SWKBD_BUTTON_CONFIRM) { devilution::CopyUtf8(event.outText, mybuf, event.maxLength); - continue; } - - devilution::CopyUtf8(event.outText, event.inText, event.maxLength); } eventCount = 0;