summaryrefslogtreecommitdiff
path: root/src/clients/s6-dnsmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/s6-dnsmx.c')
-rw-r--r--src/clients/s6-dnsmx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/clients/s6-dnsmx.c b/src/clients/s6-dnsmx.c
index a495cb2..5b8359c 100644
--- a/src/clients/s6-dnsmx.c
+++ b/src/clients/s6-dnsmx.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <sys/types.h>
#include <errno.h>
#include <skalibs/uint16.h>
#include <skalibs/uint.h>
@@ -19,7 +20,8 @@ int main (int argc, char const *const *argv)
{
genalloc mxs = GENALLOC_ZERO ; /* array of s6dns_message_rr_mx_t */
tain_t deadline ;
- unsigned int i = 0 ;
+ size_t i = 0 ;
+ unsigned int t = 0 ;
int flagqualify = 0 ;
int flagunsort = 0 ;
PROG = "s6-dnsmx" ;
@@ -31,7 +33,7 @@ int main (int argc, char const *const *argv)
{
case 'q' : flagqualify = 1 ; break ;
case 'r' : flagunsort = 1 ; break ;
- case 't' : if (!uint0_scan(subgetopt_here.arg, &i)) dieusage() ; break ;
+ case 't' : if (!uint0_scan(subgetopt_here.arg, &t)) dieusage() ; break ;
default : dieusage() ;
}
}
@@ -39,7 +41,7 @@ int main (int argc, char const *const *argv)
if (argc < 1) dieusage() ;
tain_now_g() ;
- if (i) tain_from_millisecs(&deadline, i) ; else deadline = tain_infinite_relative ;
+ if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ;
tain_add_g(&deadline, &deadline) ;
if (!s6dns_init()) strerr_diefu1sys(111, "s6dns_init") ;
{
@@ -52,7 +54,7 @@ int main (int argc, char const *const *argv)
for (i = 0 ; i < genalloc_len(s6dns_message_rr_mx_t, &mxs) ; i++)
{
char buf[S6DNS_FMT_MX] ;
- register unsigned int len = s6dns_fmt_mx(buf, S6DNS_FMT_MX, genalloc_s(s6dns_message_rr_mx_t, &mxs) + i) ;
+ register size_t len = s6dns_fmt_mx(buf, S6DNS_FMT_MX, genalloc_s(s6dns_message_rr_mx_t, &mxs) + i) ;
if (!len) strerr_diefu1sys(111, "format result") ;
if (buffer_put(buffer_1, buf, len) < 0) goto err ;
if (buffer_put(buffer_1, "\n", 1) < 0) goto err ;