summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 14:49:57 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 14:49:57 +0000
commite6767d6e47ea254f69a51dcbb733f06264c77c2c (patch)
treea59508eba61dea0b65af796ce69a7ee779646d80 /util/nvmutil
parent6f2e5149f292d7f67ffa551a0934104f7481440d (diff)
util/nvmutil: make xstrxcmp() easier to read
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 35504729..a876c5d4 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1130,7 +1130,7 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
{
size_t i;
- if (!a || !b)
+ if (a == NULL || b == NULL)
err(EINVAL, "NULL input to xstrxcmp");
if (*a == '\0' || *b == '\0')
@@ -1144,6 +1144,9 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
return 0;
}
+ /*
+ * We reached maxlen, so assume unterminated string.
+ */
err(EINVAL, "Unterminated string in xstrxcmp");
/*