diff options
author | Leah Rowe <leah@libreboot.org> | 2023-04-05 21:53:12 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-04-05 21:53:12 +0100 |
commit | b0fa54ac41e6d3078b9d967fca923764433b9f91 (patch) | |
tree | 3c4163fa9ef76a85ec1ad2be4eb883f7ae90b9dd | |
parent | 0c79a9a82e1287f12128f1fff84ec4c9551ad684 (diff) |
util/nvmutil: fix faulty zeroes-mac-address check
it was resetting the total for each nibble. absolute
epic fail on my part.
fixed now.
-rw-r--r-- | util/nvmutil/nvmutil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index d4379eec..b57965c5 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -205,7 +205,7 @@ parseMacAddress(const char *strMac, uint16_t *mac) int i, nib, byte; uint8_t val8; uint16_t val16; - uint64_t total; + uint64_t total = 0; if (strnlen(strMac, 20) != 17) return -1; @@ -215,7 +215,7 @@ parseMacAddress(const char *strMac, uint16_t *mac) if (strMac[i + 2] != ':') return -1; byte = i / 3; - for (total = 0, nib = 0; nib < 2; nib++, total += val8) { + for (nib = 0; nib < 2; nib++, total += val8) { if ((val8 = hextonum(strMac[i + nib])) > 15) return -1; if ((byte == 0) && (nib == 1)) |