util/nvmutil: clean up hextonum()

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-07 02:50:30 +00:00
parent b8bd1ca65a
commit b98f89c272
+4 -3
View File
@@ -296,7 +296,7 @@ check_cmd_args(int argc, char *argv[])
if (cmd == NULL && argc > 2) { if (cmd == NULL && argc > 2) {
/* /*
* Example: ./nvmutil gbe.bin xx:1f:16:xx:xx:xx * 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]; mac_str = argv[2];
cmd = cmd_setmac; cmd = cmd_setmac;
@@ -551,9 +551,10 @@ hextonum(char ch_s)
if ((unsigned)(ch - 'a') <= 5) if ((unsigned)(ch - 'a') <= 5)
return ch - 'a' + 10; return ch - 'a' + 10;
else if (ch == '?' || ch == 'x')
if (ch == '?' || ch == 'x')
return rhex(); /* random character */ return rhex(); /* random character */
else
return 16; /* invalid character */ return 16; /* invalid character */
} }