mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-05-27 09:05:46 +03:00
Merge pull request #23687 from yuwata/dns-domain-trivial-cleanups
dns-domain: trivial cleanups
This commit is contained in:
commit
e48bc49271
@ -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:
|
||||
|
@ -40,8 +40,8 @@ static inline int dns_name_normalize(const char *s, DNSLabelFlags flags, char **
|
||||
static inline int dns_name_is_valid(const char *s) {
|
||||
int r;
|
||||
|
||||
/* dns_name_normalize() verifies as a side effect */
|
||||
r = dns_name_normalize(s, 0, NULL);
|
||||
/* dns_name_concat() verifies as a side effect */
|
||||
r = dns_name_concat(s, NULL, 0, NULL);
|
||||
if (r == -EINVAL)
|
||||
return 0;
|
||||
if (r < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user