diff options
Diffstat (limited to 'MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c')
-rw-r--r-- | MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c index b6dc234..b2a3ef6 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c @@ -229,8 +229,8 @@ ReadString ( case CHAR_BACKSPACE:
if ((StringPtr[0] != CHAR_NULL) && (CurrentCursor != 0)) {
- for (Index = 0; Index < CurrentCursor - 1; Index++) {
- TempString[Index] = StringPtr[Index];
+ if (CurrentCursor > 1) {
+ CopyMem (TempString, StringPtr, (CurrentCursor - 1) * sizeof (CHAR16));
}
Count = GetStringWidth (StringPtr) / 2 - 1;
@@ -261,9 +261,7 @@ ReadString ( KeyPad[1] = CHAR_NULL;
Count = GetStringWidth (StringPtr) / 2 - 1;
if (CurrentCursor < Count) {
- for (Index = 0; Index < CurrentCursor; Index++) {
- TempString[Index] = StringPtr[Index];
- }
+ CopyMem (TempString, StringPtr, CurrentCursor * sizeof (CHAR16));
TempString[Index] = CHAR_NULL;
StrCatS (TempString, MaxLen, KeyPad);
|