summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/basic/path-util.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 553aa4fb58..3413056b31 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -43,12 +43,16 @@
#endif
static inline bool is_path(const char *p) {
- assert(p);
+ if (!p) /* A NULL pointer is definitely not a path */
+ return false;
+
return strchr(p, '/');
}
static inline bool path_is_absolute(const char *p) {
- assert(p);
+ if (!p) /* A NULL pointer is definitely not an absolute path */
+ return false;
+
return p[0] == '/';
}