]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
signed vs unsigned fixes
authorMark Andrews <marka@isc.org>
Wed, 14 Feb 2018 06:41:30 +0000 (17:41 +1100)
committerMark Andrews <marka@isc.org>
Fri, 16 Feb 2018 04:13:51 +0000 (15:13 +1100)
bin/dig/dig.c
bin/dig/dighost.c
bin/dig/host.c
bin/dig/include/dig/dig.h
bin/dig/nslookup.c

index a44b816604f8966cb81eea97839f7160392f6135..d0caa1b72485b9d303f7b8a22feb5936445df579 100644 (file)
@@ -276,7 +276,7 @@ help(void) {
  * Callback from dighost.c to print the received message.
  */
 static void
-received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
+received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
        isc_uint64_t diff;
        time_t tnow;
        struct tm tmnow;
@@ -1334,11 +1334,11 @@ plus_option(const char *option, isc_boolean_t is_batchfile,
 
                        result = parse_uint(&splitwidth, value,
                                            1023, "split");
-                       if (splitwidth % 4 != 0) {
+                       if ((splitwidth % 4) != 0U) {
                                splitwidth = ((splitwidth + 3) / 4) * 4;
                                fprintf(stderr, ";; Warning, split must be "
                                                "a multiple of 4; adjusting "
-                                               "to %d\n", splitwidth);
+                                               "to %u\n", splitwidth);
                        }
                        /*
                         * There is an adjustment done in the
index 75c6fea280ca19d2a3f725af329e93e7740d1a28..c9280002570d6c5f33e1ac902d9369e6a7889519 100644 (file)
@@ -374,7 +374,7 @@ isc_result_t
        isc_boolean_t headers);
 
 void
-(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query);
+(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query);
 
 void
 (*dighost_trying)(char *frm, dig_lookup_t *lookup);
@@ -448,7 +448,7 @@ hex_dump(isc_buffer_t *b) {
 
        isc_buffer_usedregion(b, &r);
 
-       printf("%d bytes\n", r.length);
+       printf("%u bytes\n", r.length);
        for (len = 0; len < r.length; len++) {
                printf("%02x ", r.base[len]);
                if (len % 16 == 15) {
@@ -583,7 +583,7 @@ debug(const char *format, ...) {
                fflush(stdout);
                if (debugtiming) {
                        TIME_NOW(&t);
-                       fprintf(stderr, "%d.%06d: ", isc_time_seconds(&t),
+                       fprintf(stderr, "%u.%06u: ", isc_time_seconds(&t),
                                isc_time_nanoseconds(&t) / 1000);
                }
                va_start(args, format);
@@ -3955,7 +3955,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
                 */
                if (l->comments)
                        printf(";; BADVERS, retrying with EDNS version %u.\n",
-                              newedns);
+                              (unsigned int)newedns);
                l->edns = newedns;
                n = requeue_lookup(l, ISC_TRUE);
                if (l->trace && l->trace_root)
index 54476b20d96e5a8993d600d408e09503a413a730..f34ca9d8d4fbad603635efacdf8449b010e733b5 100644 (file)
@@ -175,7 +175,7 @@ host_shutdown(void) {
 }
 
 static void
-received(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
+received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
        isc_time_t now;
        int diff;
 
index 2ad0769d6aad1df9d96d0e0c7b7bfcbd8e04e2ae..fe9eb8b9790ca511cc2cfb2d8b1fd5a469415a1c 100644 (file)
@@ -419,7 +419,7 @@ extern isc_result_t
  */
 
 extern void
-(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query);
+(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query);
 /*%<
  * Print a message about where and when the response
  * was received from, like the final comment in the
index 096fa6ada2ad56f597aeef056db0b107bc6afb72..e19262299508b01613b3f579803e438017af994f 100644 (file)
@@ -405,7 +405,7 @@ detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
 }
 
 static void
-received(int bytes, isc_sockaddr_t *from, dig_query_t *query)
+received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query)
 {
        UNUSED(bytes);
        UNUSED(from);
@@ -507,7 +507,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
        printf("  %s\t\t%s\n",
               usesearch ? "search" : "nosearch",
               recurse ? "recurse" : "norecurse");
-       printf("  timeout = %d\t\tretry = %d\tport = %d\tndots = %d\n",
+       printf("  timeout = %u\t\tretry = %d\tport = %u\tndots = %d\n",
               timeout, tries, port, ndots);
        printf("  querytype = %-8s\tclass = %s\n", deftype, defclass);
        printf("  srchlist = ");