summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 15:40:33 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 15:40:33 +0000
commitd9d628e1461f762185f0737528eb517c254e130e (patch)
treeb20f19e1aa55e62e1b3dcf4a12a569261aad71fb
parent036ac6dc3920c0b191a958cc7fd1239b04c4407f (diff)
util/nvmutil: tidy up check_mac_separator
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 8167100c..214ded5e 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -293,11 +293,13 @@ set_mac_byte(int mac_pos, uint64_t *total)
static void
check_mac_separator(int mac_pos)
{
+ char separator;
+
if (mac_pos == 15)
return;
- char separator = mac[mac_pos + 2];
- if (separator == ':')
+ if ((separator = mac[mac_pos + 2]) == ':')
return;
+
err(set_err(EINVAL), "Invalid MAC address separator '%c'", separator);
}