summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index ebc765da35..d6d746bc6a 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -295,7 +295,8 @@ static inline uint32_t random_u32(void) {
} \
scope type name##_from_string(const char *s) { \
type i; \
- assert(s); \
+ if (!s) \
+ return (type) -1; \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
if (name##_table[i] && \
streq(name##_table[i], s)) \