summaryrefslogtreecommitdiff
path: root/src/basic/string-util.h
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-08-14 09:16:15 +0200
committerSven Eden <yamakuzure@gmx.net>2017-08-14 09:20:53 +0200
commit2f66635635c12ee0246a5c4f771772ed2b71bec6 (patch)
tree8fdaaf3a21ce5f39638396222bbf4dedab7ba4c3 /src/basic/string-util.h
parentc59be53b8741357a7a499785bc67204a51ddde77 (diff)
Prep v235: Apply upstream fixes (3/10) [src/basic]
Diffstat (limited to 'src/basic/string-util.h')
-rw-r--r--src/basic/string-util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 46df7e42c..a28ef9c4f 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -208,3 +208,10 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase);
#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep)
bool string_is_safe(const char *p) _pure_;
+
+static inline size_t strlen_ptr(const char *s) {
+ if (!s)
+ return 0;
+
+ return strlen(s);
+}