summaryrefslogtreecommitdiff
path: root/src/shared/dns-domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-07 19:43:26 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-11 19:39:59 +0100
commitb577e3d589ec00f6d96e90b0d4bf344dbd40cd76 (patch)
tree3ef35c1801ce366abd93012ae338d91f6dbffcdc /src/shared/dns-domain.c
parentd424da2ae0860268ab863ce8945a425aa79e3826 (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.c18
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;