diff --git a/xtldr2/textui.c b/xtldr2/textui.c index 52b5755..8f3620e 100644 --- a/xtldr2/textui.c +++ b/xtldr2/textui.c @@ -528,21 +528,8 @@ BlDisplayInputDialog(IN PWCHAR Caption, } else if(Key.UnicodeChar == 0x0D) { - /* ENTER key pressed, allocate memory for updated input text */ - BufferLength = RtlWideStringLength(InputFieldBuffer, 0); - BlMemoryFreePool(*InputFieldText); - Status = BlMemoryAllocatePool(BufferLength * sizeof(WCHAR), (PVOID *)*InputFieldText); - if(Status != STATUS_EFI_SUCCESS) - { - /* Failed to allocate memory, print error message and return status code */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); - BlDisplayErrorDialog(L"XTLDR", L"Failed to save input data."); - break; - } - - /* Copy edit buffer into original buffer */ - RtlZeroMemory(InputFieldText, BufferLength * sizeof(WCHAR)); - RtlCopyMemory(*InputFieldText, InputFieldBuffer, BufferLength * sizeof(WCHAR)); + /* ENTER key pressed, update input buffer */ + *InputFieldText = InputFieldBuffer; break; } else