1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-05-28 13:05:47 +03:00

Merge pull request #23687 from yuwata/dns-domain-trivial-cleanups

dns-domain: trivial cleanups
This commit is contained in:
Luca Boccassi 2022-06-10 19:50:22 +01:00 committed by GitHub
commit e48bc49271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -450,12 +450,8 @@ int dns_name_concat(const char *a, const char *b, DNSLabelFlags flags, char **_r
return r; return r;
} }
if (!first) n += r + !first;
n++; first = false;
else
first = false;
n += r;
} }
finish: finish:

View File

@ -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) { static inline int dns_name_is_valid(const char *s) {
int r; int r;
/* dns_name_normalize() verifies as a side effect */ /* dns_name_concat() verifies as a side effect */
r = dns_name_normalize(s, 0, NULL); r = dns_name_concat(s, NULL, 0, NULL);
if (r == -EINVAL) if (r == -EINVAL)
return 0; return 0;
if (r < 0) if (r < 0)