summaryrefslogtreecommitdiff
path: root/src/basic/bus-label.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-07-20 11:38:15 +0200
committerLennart Poettering <lennart@poettering.net>2017-07-31 18:20:28 +0200
commit7bf7ce28b5a1f589f0f2382e54c03ab9b0794fab (patch)
tree701387d210e1e75c063a734ea6fe13bf33d88f87 /src/basic/bus-label.h
parent6f8cbcdb27d772521ba71f92c25fd522efd56cf4 (diff)
downloadsystemd-7bf7ce28b5a1f589f0f2382e54c03ab9b0794fab.tar.gz
string-util: add strlen_ptr() helper
strlen_ptr() is to strlen() what streq_ptr() is to streq(): i.e. it handles NULL strings in a smart way.
Diffstat (limited to 'src/basic/bus-label.h')
-rw-r--r--src/basic/bus-label.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/bus-label.h b/src/basic/bus-label.h
index 62fb2c450c..600268b767 100644
--- a/src/basic/bus-label.h
+++ b/src/basic/bus-label.h
@@ -23,9 +23,11 @@
#include <stdlib.h>
#include <string.h>
+#include "string-util.h"
+
char *bus_label_escape(const char *s);
char *bus_label_unescape_n(const char *f, size_t l);
static inline char *bus_label_unescape(const char *f) {
- return bus_label_unescape_n(f, f ? strlen(f) : 0);
+ return bus_label_unescape_n(f, strlen_ptr(f));
}