From: Yu Watanabe Date: Thu, 20 May 2021 05:58:12 +0000 (+0900) Subject: systemctl: use strextend_with_separator() X-Git-Tag: v249-rc1~182^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=742a011a3ae9bd5e0a493015c9f4baf9598c99cb;p=thirdparty%2Fsystemd.git systemctl: use strextend_with_separator() --- diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index a45f5fa363a..3686ac3c768 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -1659,14 +1659,9 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m if (r < 0) return r; - while ((r = sd_bus_message_read(m, "(ss)", &partition, &mount_options)) > 0) { - _cleanup_free_ char *previous = NULL; - - previous = TAKE_PTR(str); - str = strjoin(strempty(previous), previous ? ":" : "", partition, ":", mount_options); - if (!str) + while ((r = sd_bus_message_read(m, "(ss)", &partition, &mount_options)) > 0) + if (!strextend_with_separator(&str, ":", partition, ":", mount_options)) return log_oom(); - } if (r < 0) return r;