Skip to content

Commit

Permalink
Wrong cast in GetBootFromOption().
Browse files Browse the repository at this point in the history
  • Loading branch information
jief666 committed Aug 19, 2020
1 parent 8b6f19f commit 2607bd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions rEFIt_UEFI/Platform/Settings.cpp
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions rEFIt_UEFI/refit/main.cpp
Expand Up @@ -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]) {
Expand Down

0 comments on commit 2607bd4

Please sign in to comment.