mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 13:16:47 +02:00
util/nvmutil: make xstrxcmp() easier to read
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1130,7 +1130,7 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!a || !b)
|
if (a == NULL || b == NULL)
|
||||||
err(EINVAL, "NULL input to xstrxcmp");
|
err(EINVAL, "NULL input to xstrxcmp");
|
||||||
|
|
||||||
if (*a == '\0' || *b == '\0')
|
if (*a == '\0' || *b == '\0')
|
||||||
@@ -1144,6 +1144,9 @@ xstrxcmp(const char *a, const char *b, size_t maxlen)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We reached maxlen, so assume unterminated string.
|
||||||
|
*/
|
||||||
err(EINVAL, "Unterminated string in xstrxcmp");
|
err(EINVAL, "Unterminated string in xstrxcmp");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user