summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-25 22:42:36 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-26 14:42:04 +0100
commitd390f8ef2dc0cd041914d3c2fd3e1081605cbfc8 (patch)
treebaea925afd20e984696718b5813c2441444184ab /src/network/networkd-manager.c
parentb2a81c0b524fee0a1713720462b6db5c302c3933 (diff)
util: introduce fputs_with_space() and make use of it at various places
The call combines outputing a string with prefixing it with a space, optionally. This is useful to shorten the logic for outputing lists of strings, that are space separated.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 723a92b5b8..c10635d202 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -822,12 +822,9 @@ static void print_string_set(FILE *f, const char *field, OrderedSet *s) {
fputs(field, f);
- ORDERED_SET_FOREACH(p, s, i) {
- if (space)
- fputc(' ', f);
- fputs(p, f);
- space = true;
- }
+ ORDERED_SET_FOREACH(p, s, i)
+ fputs_with_space(f, p, NULL, &space);
+
fputc('\n', f);
}