File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 19
19
#include <stdio.h>
20
20
#include "ntloader.h"
21
21
#include "cmdline.h"
22
+ #include "charset.h"
22
23
#include "efi.h"
23
24
#include "efifile.h"
24
25
#include "efiblock.h"
@@ -55,14 +56,16 @@ const char sbat[ sizeof (SBAT_CSV) - 1 ] __sbat = SBAT_CSV;
55
56
static void efi_cmdline (EFI_LOADED_IMAGE_PROTOCOL * loaded )
56
57
{
57
58
size_t cmdline_len = (loaded -> LoadOptionsSize / sizeof (wchar_t ));
58
- char cmdline [ cmdline_len + 1 /* NUL */ ];
59
- const wchar_t * wcmdline = loaded -> LoadOptions ;
59
+ char * cmdline = efi_malloc (4 * cmdline_len + 1 );
60
60
61
61
/* Convert command line to ASCII */
62
- snprintf (cmdline , sizeof (cmdline ), "%ls" , wcmdline );
62
+ * ucs2_to_utf8 ((uint8_t * ) cmdline ,
63
+ loaded -> LoadOptions , cmdline_len ) = 0 ;
63
64
64
65
/* Process command line */
65
66
process_cmdline (cmdline );
67
+
68
+ efi_free (cmdline );
66
69
}
67
70
68
71
/**
You can’t perform that action at this time.
0 commit comments