chiark / gitweb /
@@ -3,6 +3,8 @@
authorian <ian>
Tue, 9 May 2006 19:37:58 +0000 (19:37 +0000)
committerian <ian>
Tue, 9 May 2006 19:37:58 +0000 (19:37 +0000)
     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
client/adnsheloex.c
client/adnslogres.c

index fe1086ac645e6f73a37c5be1a79a45ed0dff39c2..bb2d2d886e688ebb54473e4f97267135d80781c9 100644 (file)
--- 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.)
 
  --
 
index 7627793fcd0b21b32f5418f3b671f6cee8174089..829c2d562e928eef8466fa1ff41aaf7f975301d3 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 static const char * const cvsid =
-       "$Id: adnsheloex.c,v 1.2 2006/04/08 14:36:57 ian Exp $";
+       "$Id: adnsheloex.c,v 1.3 2006/05/09 19:37:58 ian Exp $";
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -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));
index c9761fc369d65db0c7dcdc34bd07a8b483822d1c..486806a3ee0d1b403011240955b7b1bed065ff6d 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 static const char * const cvsid =
-       "$Id: adnslogres.c,v 1.22 2006/04/08 14:36:57 ian Exp $";
+       "$Id: adnslogres.c,v 1.23 2006/05/09 19:37:58 ian Exp $";
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -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);