mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-25 07:46:17 +02:00
util/nvmutil: clean up hextonum()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -296,7 +296,7 @@ check_cmd_args(int argc, char *argv[])
|
||||
if (cmd == NULL && argc > 2) {
|
||||
/*
|
||||
* Example: ./nvmutil gbe.bin xx:1f:16:xx:xx:xx
|
||||
* Eqivalent ./nvmutil gbe.bin setmac xx:1f:16:xx:xx:xx
|
||||
* Equivalent ./nvmutil gbe.bin setmac xx:1f:16:xx:xx:xx
|
||||
*/
|
||||
mac_str = argv[2];
|
||||
cmd = cmd_setmac;
|
||||
@@ -551,9 +551,10 @@ hextonum(char ch_s)
|
||||
|
||||
if ((unsigned)(ch - 'a') <= 5)
|
||||
return ch - 'a' + 10;
|
||||
else if (ch == '?' || ch == 'x')
|
||||
|
||||
if (ch == '?' || ch == 'x')
|
||||
return rhex(); /* random character */
|
||||
else
|
||||
|
||||
return 16; /* invalid character */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user