From 9571af3d83d91b26acba74630809c422aacd9789 Mon Sep 17 00:00:00 2001 From: asava Date: Tue, 12 May 2020 16:21:15 +0300 Subject: [PATCH] Correct error in egSaveFile causing for example folder instead of screenshot --- rEFIt_UEFI/libeg/image.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rEFIt_UEFI/libeg/image.cpp b/rEFIt_UEFI/libeg/image.cpp index aab1417f9..635bbcbc8 100644 --- a/rEFIt_UEFI/libeg/image.cpp +++ b/rEFIt_UEFI/libeg/image.cpp @@ -159,6 +159,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File } dirNameLen = p - FileName; StrnCpy(DirName, FileName, dirNameLen); + DirName[dirNameLen] = L'\0'; Status = BaseDir->Open(BaseDir, &FileHandle, DirName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, EFI_FILE_DIRECTORY);