Wrong cast in GetBootFromOption().

This commit is contained in:
jief666 2020-08-19 22:29:26 +03:00
parent 8b6f19f2c6
commit 2607bd4fbb
2 changed files with 11 additions and 11 deletions

View File

@ -327,12 +327,12 @@ GetBootFromOption(VOID)
NameSize = *(UINT16*)Data;
Data += 2; // pointer to Volume name
gSettings.DefaultVolume.strncpy((const char*)Data, NameSize);
gSettings.DefaultVolume.strncpy((__typeof__(gSettings.DefaultVolume.wc_str()))Data, NameSize);
Data += NameSize;
Name2Size = Len - NameSize;
if (Name2Size != 0) {
gSettings.DefaultLoader.strncpy((const char*)Data, NameSize);
gSettings.DefaultLoader.strncpy((__typeof__(gSettings.DefaultVolume.wc_str()))Data, NameSize);
}
DBG("Clover started with option to boot %ls from %ls\n",

View File

@ -1938,17 +1938,17 @@ RefitMain (IN EFI_HANDLE ImageHandle,
GetBootFromOption();
} else {
ParseLoadOptions(&ConfName, &gConfigDict[1]);
if (ConfName.isEmpty()) {
if (ConfName.isEmpty()) {
gConfigDict[1] = NULL;
} else {
SetOEMPath(ConfName);
Status = LoadUserSettings(SelfRootDir, ConfName, &gConfigDict[1]);
DBG("%ls\\%ls.plist%ls loaded with name from LoadOptions: %s\n",
OEMPath.wc_str(), ConfName.wc_str(), EFI_ERROR(Status) ? L" not" : L"", strerror(Status));
if (EFI_ERROR(Status)) {
gConfigDict[1] = NULL;
} else {
SetOEMPath(ConfName);
Status = LoadUserSettings(SelfRootDir, ConfName, &gConfigDict[1]);
DBG("%ls\\%ls.plist%ls loaded with name from LoadOptions: %s\n",
OEMPath.wc_str(), ConfName.wc_str(), EFI_ERROR(Status) ? L" not" : L"", strerror(Status));
if (EFI_ERROR(Status)) {
gConfigDict[1] = NULL;
}
}
}
}
}
if (gConfigDict[1]) {