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
3d995d8c97
commit
d779b3e0fc
|
|
@ -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 New Issue