]> 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 06:42:57 +0000 (17:42 +1100)
bin/dig/dig.c
bin/dig/dighost.c
bin/dig/host.c
bin/dig/include/dig/dig.h
bin/dig/nslookup.c

index 6b3f6552e200b51e8fbadfbc34f5c981ff256770..43dd2babb334bff9054ed73f584cbe1553b8df1f 100644 (file)
@@ -258,7 +258,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;
@@ -1157,11 +1157,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 84a588994c5d614aee10bcdf6ea63012c8eb6500..ea8c52ba98460774e47d09f654326d2eb8db4648 100644 (file)
@@ -362,7 +362,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);
@@ -436,7 +436,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) {
@@ -571,7 +571,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);
index 542353183fb94907c8cccdd9763109b6e4721343..af56cec632a47652b6d5f1562ca4ec113c8e727f 100644 (file)
@@ -176,7 +176,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 82c179caebf9c7a4bde909c1b6f4839801b76e74..01ca484c466a24347ab10918cefb6377d64c520a 100644 (file)
@@ -398,7 +398,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 ed391704cb49e1c45b5a4b2d70e14681135448be..62b19f5f0d771ae95031f19e636220989e3c5121 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 = ");