mirror of https://github.com/ncroxon/gnu-efi
Don't pass a pointer-to-(LoadedImage *) as a void **;
pass in a real void pointer's address and cast it reasonably. Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
This commit is contained in:
parent
1ecae7d44c
commit
087d22af38
|
@ -31,7 +31,7 @@ GetShellArgcArgvFromLoadedImage(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_LOADED_IMAGE *LoadedImage = NULL;
|
void *LoadedImage = NULL;
|
||||||
static CHAR16 ArgvContents[MAX_CMDLINE_SIZE];
|
static CHAR16 ArgvContents[MAX_CMDLINE_SIZE];
|
||||||
static CHAR16 *Argv[MAX_CMDLINE_ARGC], *ArgStart, *c;
|
static CHAR16 *Argv[MAX_CMDLINE_ARGC], *ArgStart, *c;
|
||||||
UINTN Argc = 0, BufLen;
|
UINTN Argc = 0, BufLen;
|
||||||
|
@ -47,13 +47,13 @@ GetShellArgcArgvFromLoadedImage(
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
BufLen = LoadedImage->LoadOptionsSize;
|
BufLen = ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptionsSize;
|
||||||
if (BufLen < 2) /* We are expecting at least a \0 */
|
if (BufLen < 2) /* We are expecting at least a \0 */
|
||||||
return -1;
|
return -1;
|
||||||
else if (BufLen > sizeof(ArgvContents))
|
else if (BufLen > sizeof(ArgvContents))
|
||||||
BufLen = sizeof(ArgvContents);
|
BufLen = sizeof(ArgvContents);
|
||||||
|
|
||||||
CopyMem(ArgvContents, LoadedImage->LoadOptions, BufLen);
|
CopyMem(ArgvContents, ((EFI_LOADED_IMAGE *)LoadedImage)->LoadOptions, BufLen);
|
||||||
ArgvContents[MAX_CMDLINE_SIZE - 1] = L'\0';
|
ArgvContents[MAX_CMDLINE_SIZE - 1] = L'\0';
|
||||||
|
|
||||||
for (c = ArgStart = ArgvContents ; *c != L'\0' ; ++c) {
|
for (c = ArgStart = ArgvContents ; *c != L'\0' ; ++c) {
|
||||||
|
|
Loading…
Reference in New Issue