summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_domain_fromstring.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-04-27 12:48:31 +0000
committerLaurent Bercot <ska@appnovation.com>2024-04-27 12:48:31 +0000
commit33e4b9d9137b5dbb02a087956f1558ef30647aea (patch)
treebb9578695eabce49207ad2d4aa3593e950778e25 /src/libs6dns/s6dns_domain_fromstring.c
parent51196c1512f071bec38064f8add058f52542976b (diff)
downloads6-dns-33e4b9d9137b5dbb02a087956f1558ef30647aea.tar.xz
Prepare for 2.3.7.2; implement dns-0x20
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6dns/s6dns_domain_fromstring.c')
-rw-r--r--src/libs6dns/s6dns_domain_fromstring.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs6dns/s6dns_domain_fromstring.c b/src/libs6dns/s6dns_domain_fromstring.c
index b87ee10..c8e553b 100644
--- a/src/libs6dns/s6dns_domain_fromstring.c
+++ b/src/libs6dns/s6dns_domain_fromstring.c
@@ -2,7 +2,8 @@
#include <string.h>
#include <errno.h>
-#include <skalibs/bytestr.h>
+#include <ctype.h>
+
#include <s6-dns/s6dns-domain.h>
int s6dns_domain_fromstring (s6dns_domain_t *d, char const *s, size_t len)
@@ -16,7 +17,7 @@ int s6dns_domain_fromstring (s6dns_domain_t *d, char const *s, size_t len)
if (lastdot)
{
if ((j >= 255) || (lastdot++ >= 64)) return (errno = ENAMETOOLONG, 0) ;
- d->s[j++] = s[i] ;
+ d->s[j++] = tolower(s[i]) ;
}
if (s[i] == '.') lastdot = 0 ;
else if (!lastdot)
@@ -25,7 +26,6 @@ int s6dns_domain_fromstring (s6dns_domain_t *d, char const *s, size_t len)
lastdot = 1 ;
}
}
- case_lowerb(d->s + 1, j-1) ;
d->len = j ;
return 1 ;
}