diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-07 02:50:30 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-07 02:50:30 +0000 |
| commit | b98f89c272937d06b6ead969f3dac6ba94fe0551 (patch) | |
| tree | 4704e3e97b2b72fda7b934ea5878ba8c6a6978d5 /util | |
| parent | b8bd1ca65ab5f04a33b1edc6f85ed0a4a26f2c65 (diff) | |
util/nvmutil: clean up hextonum()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 73b8ec00..7bd61704 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; @@ -501,7 +501,7 @@ set_mac_byte(size_t mac_byte_pos) static void set_mac_nib(size_t mac_str_pos, - size_t mac_byte_pos, size_t mac_nib_pos) + size_t mac_byte_pos, size_t mac_nib_pos) { char mac_ch; uint16_t hex_num; @@ -551,10 +551,11 @@ 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 */ + + return 16; /* invalid character */ } static uint8_t |
