summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 15:06:01 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 15:06:01 +0000
commit1d630f8e36effef914235ca9a891e4880612a034 (patch)
treee0d60889887db37b8b558393d3d258345a61ac2a /util/nvmutil/nvmutil.c
parent502aeb865360db2c6f7f837a844f15529c46d0ea (diff)
util/nvmutil: set errno in xstrxcmp
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 1eaa6a16..cd3d3650 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1152,6 +1152,14 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
/*
* Should never reach here. This keeps compilers happy.
*/
+
+ /*
+ * If we do reach here, we want some way to crash
+ * nvmutil before writing anything to disk.
+ *
+ * It checks errno extremely obsessively.
+ */
+ errno = EINVAL;
return -1;
}