summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-31 19:51:11 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-31 19:51:11 +0200
commit07bed172edc819cf85b72d5c67613511cbde5453 (patch)
tree499ada6aeae031ee1d5dde78010db8b95c5b749b /src
parentfd0b4602f6332c3f1660eb208c8f5c719709a009 (diff)
resolved: various fixes regarding encoding of UTF8 characters in DNS RRs
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-domain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/resolve/resolved-dns-domain.c b/src/resolve/resolved-dns-domain.c
index f3e7df7a1e..c2a435944c 100644
--- a/src/resolve/resolved-dns-domain.c
+++ b/src/resolve/resolved-dns-domain.c
@@ -88,7 +88,7 @@ int dns_label_unescape(const char **name, char *dest, size_t sz) {
} else
return -EINVAL;
- } else if (*n >= ' ' && *n != 127) {
+ } else if ((uint8_t) *n >= (uint8_t) ' ' && *n != 127) {
/* Normal character */
*(d++) = *(n++);
@@ -141,13 +141,13 @@ int dns_label_escape(const char *p, size_t l, char **ret) {
/* Proper character */
*(q++) = *p;
- } else if (*p >= ' ' && *p != 127) {
+ } else if ((uint8_t) *p >= (uint8_t) ' ' && *p != 127) {
/* Everything else */
*(q++) = '\\';
- *(q++) = '0' + (char) ((unsigned) *p / 100);
- *(q++) = '0' + (char) (((unsigned) *p / 10) % 10);
- *(q++) = '0' + (char) ((unsigned) *p % 10);
+ *(q++) = '0' + (char) ((uint8_t) *p / 100);
+ *(q++) = '0' + (char) (((uint8_t) *p / 10) % 10);
+ *(q++) = '0' + (char) ((uint8_t) *p % 10);
} else
return -EINVAL;