Skip to content

Commit

Permalink
Chore (Windows): use standard libc api
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Sep 20, 2024
1 parent 85a31c7 commit 866c730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/detection/bootmgr/bootmgr_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const char* ffDetectBootmgr(FFBootmgrResult* result)

uint8_t buffer[2048];
wchar_t key[16];
wsprintfW(key, L"Boot%04X", value);
swprintf(key, sizeof(key) / sizeof(*key), L"Boot%04X", value);
uint32_t size = GetFirmwareEnvironmentVariableW(key, L"{" FF_EFI_GLOBAL_GUID L"}", buffer, sizeof(buffer));
if (size < sizeof(FFEfiLoadOption) || size == sizeof(buffer))
return "GetFirmwareEnvironmentVariableW(Boot####) failed";
Expand Down

0 comments on commit 866c730

Please sign in to comment.