diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-12 15:35:29 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-01-12 15:35:29 +0000 |
commit | 3f9536c5cc9ed6659ad2514859bd1716cbf7b26b (patch) | |
tree | 3f01ca46f59b9458c93ace3f07127d1e2bb460e8 /src/clients/s6dns_namescanner.c | |
parent | 3a289d1ca8dd2bce4a8bb6549709ea62262ec786 (diff) | |
download | s6-dns-3f9536c5cc9ed6659ad2514859bd1716cbf7b26b.tar.xz |
Types fix, first pass.
Some places marked XXX for the skalibs API change.
Diffstat (limited to 'src/clients/s6dns_namescanner.c')
-rw-r--r-- | src/clients/s6dns_namescanner.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/clients/s6dns_namescanner.c b/src/clients/s6dns_namescanner.c index 136b1e8..c2110d2 100644 --- a/src/clients/s6dns_namescanner.c +++ b/src/clients/s6dns_namescanner.c @@ -1,12 +1,16 @@ /* ISC license. */ +#include <sys/types.h> +#include <limits.h> +#include <errno.h> #include <s6-dns/s6dns-domain.h> #include "s6dns-generic-filter.h" -unsigned int s6dns_namescanner (s6dns_domain_t *d, char const *s) +size_t s6dns_namescanner (s6dns_domain_t *d, char const *s) { - register unsigned int pos = 0 ; + register size_t pos = 0 ; while (s[pos] && (s[pos] != ' ') && (s[pos] != '\t') && (s[pos] != '\r') && (s[pos] != '\n')) pos++ ; + if (pos > UINT_MAX) return (errno = ENAMETOOLONG, 0) ; if (!s6dns_domain_fromstring_noqualify_encode(d, s, pos)) return 0 ; return pos ; } |