Skip to content

Commit 2607bd4

Browse files
committed
Wrong cast in GetBootFromOption().
1 parent 8b6f19f commit 2607bd4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

rEFIt_UEFI/Platform/Settings.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,12 @@ GetBootFromOption(VOID)
327327
NameSize = *(UINT16*)Data;
328328

329329
Data += 2; // pointer to Volume name
330-
gSettings.DefaultVolume.strncpy((const char*)Data, NameSize);
330+
gSettings.DefaultVolume.strncpy((__typeof__(gSettings.DefaultVolume.wc_str()))Data, NameSize);
331331

332332
Data += NameSize;
333333
Name2Size = Len - NameSize;
334334
if (Name2Size != 0) {
335-
gSettings.DefaultLoader.strncpy((const char*)Data, NameSize);
335+
gSettings.DefaultLoader.strncpy((__typeof__(gSettings.DefaultVolume.wc_str()))Data, NameSize);
336336
}
337337

338338
DBG("Clover started with option to boot %ls from %ls\n",

rEFIt_UEFI/refit/main.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1938,17 +1938,17 @@ RefitMain (IN EFI_HANDLE ImageHandle,
19381938
GetBootFromOption();
19391939
} else {
19401940
ParseLoadOptions(&ConfName, &gConfigDict[1]);
1941-
if (ConfName.isEmpty()) {
1941+
if (ConfName.isEmpty()) {
1942+
gConfigDict[1] = NULL;
1943+
} else {
1944+
SetOEMPath(ConfName);
1945+
Status = LoadUserSettings(SelfRootDir, ConfName, &gConfigDict[1]);
1946+
DBG("%ls\\%ls.plist%ls loaded with name from LoadOptions: %s\n",
1947+
OEMPath.wc_str(), ConfName.wc_str(), EFI_ERROR(Status) ? L" not" : L"", strerror(Status));
1948+
if (EFI_ERROR(Status)) {
19421949
gConfigDict[1] = NULL;
1943-
} else {
1944-
SetOEMPath(ConfName);
1945-
Status = LoadUserSettings(SelfRootDir, ConfName, &gConfigDict[1]);
1946-
DBG("%ls\\%ls.plist%ls loaded with name from LoadOptions: %s\n",
1947-
OEMPath.wc_str(), ConfName.wc_str(), EFI_ERROR(Status) ? L" not" : L"", strerror(Status));
1948-
if (EFI_ERROR(Status)) {
1949-
gConfigDict[1] = NULL;
1950-
}
19511950
}
1951+
}
19521952
}
19531953
}
19541954
if (gConfigDict[1]) {

0 commit comments

Comments
 (0)