summaryrefslogtreecommitdiffstats
path: root/src/shared/dns-domain.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-06-10 02:49:07 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-06-10 02:49:07 +0200
commit47484dd95538a0f9f43add4f7655dcfa2b5d97d9 (patch)
tree4677fb76ea8874e18256ac1db3bf8dbfc09c6a76 /src/shared/dns-domain.c
parentdns-domain: use dns_name_concat() (diff)
downloadsystemd-47484dd95538a0f9f43add4f7655dcfa2b5d97d9.tar.xz
systemd-47484dd95538a0f9f43add4f7655dcfa2b5d97d9.zip
dns-domain: simplify code a bit
Diffstat (limited to 'src/shared/dns-domain.c')
-rw-r--r--src/shared/dns-domain.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index 0ae1de1c5b..9acf1cb0d6 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -450,12 +450,8 @@ int dns_name_concat(const char *a, const char *b, DNSLabelFlags flags, char **_r
return r;
}
- if (!first)
- n++;
- else
- first = false;
-
- n += r;
+ n += r + !first;
+ first = false;
}
finish: