summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-dns-domain.c')
-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;