diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-07 19:43:26 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-11 19:39:59 +0100 |
commit | b577e3d589ec00f6d96e90b0d4bf344dbd40cd76 (patch) | |
tree | 3ef35c1801ce366abd93012ae338d91f6dbffcdc /src/shared/dns-domain.c | |
parent | d424da2ae0860268ab863ce8945a425aa79e3826 (diff) |
basic: introduce generic ascii_strlower_n() call and make use of it everywhere
Diffstat (limited to 'src/shared/dns-domain.c')
-rw-r--r-- | src/shared/dns-domain.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 68404ca9e5..3848a0518d 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -913,19 +913,11 @@ int dns_name_to_wire_format(const char *domain, uint8_t *buffer, size_t len, boo if (r < 0) return r; - if (canonical) { - size_t i; - - /* Optionally, output the name in DNSSEC - * canonical format, as described in RFC 4034, - * section 6.2. Or in other words: in - * lower-case. */ - - for (i = 0; i < (size_t) r; i++) { - if (out[i] >= 'A' && out[i] <= 'Z') - out[i] = out[i] - 'A' + 'a'; - } - } + /* Optionally, output the name in DNSSEC canonical + * format, as described in RFC 4034, section 6.2. Or + * in other words: in lower-case. */ + if (canonical) + ascii_strlower_n((char*) out, (size_t) r); /* Fill label length, move forward */ *label_length = r; |