X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fgenerator.c;h=2f9e5954c20d363bb2f29024b95cf6efd9b9e1dd;hp=5d5b6a0a61cc3b5d30caecd07fc6685fa9e97637;hb=36a259d22c450fbf3f696df0161db50275a98667;hpb=c9fa3670bf24edf51c59c6e3904c2d0a1dd4b59d diff --git a/src/shared/generator.c b/src/shared/generator.c index 5d5b6a0a6..2f9e5954c 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -125,7 +125,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher char *prefix, *postfix; prefix = strndupa(opts, start - opts - (start != opts)); - postfix = timeout + len + (timeout[len] != '\0'); + postfix = timeout + len + (start == opts && timeout[len] != '\0'); *filtered = strjoin(prefix, *postfix ? postfix : NULL, NULL); if (!*filtered) return log_oom();