1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

pid1: use strextend_with_separator()

This commit is contained in:
Yu Watanabe 2021-05-20 14:19:22 +09:00
parent 2b070200f1
commit a2a7b77260

View File

@ -181,7 +181,7 @@ int bus_read_mount_options(
return r; return r;
while ((r = sd_bus_message_read(message, "(ss)", &partition, &mount_options)) > 0) { while ((r = sd_bus_message_read(message, "(ss)", &partition, &mount_options)) > 0) {
_cleanup_free_ char *previous = NULL, *escaped = NULL; _cleanup_free_ char *escaped = NULL;
_cleanup_free_ MountOptions *o = NULL; _cleanup_free_ MountOptions *o = NULL;
PartitionDesignator partition_designator; PartitionDesignator partition_designator;
@ -198,9 +198,7 @@ int bus_read_mount_options(
if (!escaped) if (!escaped)
return -ENOMEM; return -ENOMEM;
previous = TAKE_PTR(format_str); if (!strextend_with_separator(&format_str, separator, partition, ":", escaped))
format_str = strjoin(previous, previous ? separator : "", partition, ":", escaped);
if (!format_str)
return -ENOMEM; return -ENOMEM;
o = new(MountOptions, 1); o = new(MountOptions, 1);