summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util/strv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/util/strv.c b/lib/util/strv.c
index 864a3e5cf8b..328f561722b 100644
--- a/lib/util/strv.c
+++ b/lib/util/strv.c
@@ -79,7 +79,9 @@ static bool strv_valid_entry(const char *strv, size_t strv_len,
return false;
}
- *entry_len = strlen(entry);
+ if (entry_len != NULL) {
+ *entry_len = strlen(entry);
+ }
return true;
}
@@ -91,7 +93,7 @@ char *strv_next(char *strv, const char *entry)
char *result;
if (entry == NULL) {
- if (strv_valid_entry(strv, len, strv, &entry_len)) {
+ if (strv_valid_entry(strv, len, strv, NULL)) {
return strv;
}
return NULL;