chiark / gitweb /
+ * Cast ptrdiff_t to int for %.*s length in adnsheloex and adnslogres,
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)
@@ -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
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 aeb392af83cd10cd70146c76216c72f3e91ad78d..a4ad542cc08bfa12487c583db1ab6379b403a44d 100644 (file)
@@ -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 10d95f06bb0defbb279ba7b314aef5342fc9d6db..50ba58d587712fae6189e1d31f495b74789031a6 100644 (file)
@@ -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);