summaryrefslogtreecommitdiff
path: root/src/basic/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-19 00:50:34 +0200
committerSven Eden <yamakuzure@gmx.net>2017-03-29 10:45:10 +0200
commit3c5cadf3384cbc335697092e1fb6faba9c90b6b0 (patch)
treed791b3ed2989ae938f02062a7ab094307b5355da /src/basic/util.c
parenta28c2a18b536be662e4e5cbae6ded84a8866d9fd (diff)
util: clean-ups to enum parsers
Never log when we fail due to OOM when translating enums, let the caller do that. Translating basic types like enums should be something where the caller logs, not the translatior functions. Return -1 when NULL is passed to all enum parser functions. The non-fallback versions of the enum translator calls already handle NULL as failure, instead of hitting an assert, and we should do this here, too.
Diffstat (limited to 'src/basic/util.c')
-rw-r--r--src/basic/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 707b0fab6..6063b1beb 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6627,7 +6627,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
for (i = 0; i < len; ++i)
if (streq_ptr(table[i], key))
- return (ssize_t)i;
+ return (ssize_t) i;
return -1;
}