From bf41c1c2f7c3d6ff50211cf8b7b75bf245bab110 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Tue, 9 May 2006 19:37:58 +0000 Subject: [PATCH] + * Cast ptrdiff_t to int for %.*s length in adnsheloex and adnslogres, Organization: Straylight/Edgeware From: ian @@ -3,6 +3,8 @@ suppress spurious autoconf error. (Report from Mihai Ibanescu.) + * Cast ptrdiff_t to int for %.*s length in adnsheloex and adnslogres, + as is required. (Report from Jim Meyering.) --- changelog | 2 ++ client/adnsheloex.c | 4 ++-- client/adnslogres.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/changelog b/changelog index fe1086a..bb2d2d8 100644 --- a/changelog +++ b/changelog @@ -3,6 +3,8 @@ adns (1.3); urgency=low Bugfixes: * In configure.in, quote macro name argument to define() to suppress spurious autoconf error. (Report from Mihai Ibanescu.) + * Cast ptrdiff_t to int for %.*s length in adnsheloex and adnslogres, + as is required. (Report from Jim Meyering.) -- diff --git a/client/adnsheloex.c b/client/adnsheloex.c index aeb392a..a4ad542 100644 --- a/client/adnsheloex.c +++ b/client/adnsheloex.c @@ -168,7 +168,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) { if (head->query) { if (opts & OPT_DEBUG) msg("%d in queue; checking %.*s", len, - head->rest-head->name, guard_null(head->name)); + (int)(head->rest-head->name), guard_null(head->name)); if (eof || len >= maxpending) { if (opts & OPT_POLL) err= adns_wait_poll(adns, &head->query, &answer, NULL); @@ -185,7 +185,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) { if (answer->status == adns_s_ok) { const char *addr; int ok = 0; - fprintf(outf, "%.*s", head->rest-head->start, head->start); + fprintf(outf, "%.*s", (int)(head->rest-head->start), head->start); while(answer->nrrs--) { addr= inet_ntoa(answer->rrs.inaddr[answer->nrrs]); ok |= !strncmp(addr, head->addr, strlen(addr)); diff --git a/client/adnslogres.c b/client/adnslogres.c index 10d95f0..50ba58d 100644 --- a/client/adnslogres.c +++ b/client/adnslogres.c @@ -154,7 +154,7 @@ static logline *readline(FILE *inf, adns_state adns, int opts) { strcpy(line->start, buf); str= ipaddr2domain(line->start, &line->addr, &line->rest); if (opts & OPT_DEBUG) - msg("submitting %.*s -> %s", line->rest-line->addr, guard_null(line->addr), str); + msg("submitting %.*s -> %s", (int)(line->rest-line->addr), guard_null(line->addr), str); if (adns_submit(adns, str, adns_r_ptr, adns_qf_quoteok_cname|adns_qf_cname_loose, NULL, &line->query)) @@ -186,7 +186,7 @@ static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) { while (head) { if (opts & OPT_DEBUG) msg("%d in queue; checking %.*s", len, - head->rest-head->addr, guard_null(head->addr)); + (int)(head->rest-head->addr), guard_null(head->addr)); if (eof || len >= maxpending) { if (opts & OPT_POLL) err= adns_wait_poll(adns, &head->query, &answer, NULL); -- [mdw]