summaryrefslogtreecommitdiff
path: root/src/basic/string-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-10 17:11:19 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:50:03 +0200
commit843a078dc2b5e0d416c078475466df225d0c99ae (patch)
tree7e49f72cd5482b0c02178b2264456e18fcbc5d46 /src/basic/string-util.h
parentee48474e9555de15ce709f327054a2c747698c93 (diff)
cocci: use strempty() at more places
This shortens the code by a few lines.
Diffstat (limited to 'src/basic/string-util.h')
-rw-r--r--src/basic/string-util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 5ee7442d9..7cbfef725 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -52,15 +52,15 @@ static inline bool streq_ptr(const char *a, const char *b) {
}
static inline const char* strempty(const char *s) {
- return s ? s : "";
+ return s ?: "";
}
static inline const char* strnull(const char *s) {
- return s ? s : "(null)";
+ return s ?: "(null)";
}
static inline const char *strna(const char *s) {
- return s ? s : "n/a";
+ return s ?: "n/a";
}
static inline bool isempty(const char *p) {