Fix hex representation of binary variable contents
The getenv code was mishandling the conversion of binary to hex. Grub's sprintf() doesn't seem to support the full set of format conversions, so fix this in the nasty way.
This commit is contained in:
parent
92e46cccf1
commit
73746f0367
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ grub_cmd_getenv (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
{
|
||||
bindata = grub_zalloc(datasize * 2 + 1);
|
||||
for (i=0; i<datasize; i++)
|
||||
grub_snprintf(bindata + i*2, 3, "%02x", data[i]);
|
||||
grub_snprintf(bindata + i*2, 3, "%02x", data[i] & 0xff);
|
||||
|
||||
if (grub_env_set (args[0], bindata))
|
||||
goto done;
|
||||
|
|
Loading…
Reference in a new issue