From: Zbigniew Jędrzejewski-Szmek Date: Sun, 25 Feb 2018 20:59:04 +0000 (+0100) Subject: core/path: add one more assert X-Git-Tag: v238~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80127127914b1e511d93263621b6e468953c75b8;p=thirdparty%2Fsystemd.git core/path: add one more assert --- diff --git a/src/core/path.c b/src/core/path.c index 8a5ec0a72f6..1893d8de458 100644 --- a/src/core/path.c +++ b/src/core/path.c @@ -80,7 +80,8 @@ int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler) { (void) sd_event_source_set_description(s->event_source, "path"); - /* This assumes the path was passed through path_kill_slashes()! */ + /* This function assumes the path was passed through path_kill_slashes()! */ + assert(!strstr(s->path, "//")); for (slash = strchr(s->path, '/'); ; slash = strchr(slash+1, '/')) { char *cut = NULL;