]> 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>
Thu, 15 Feb 2018 23:19:57 +0000 (10:19 +1100)
bin/dig/dig.c
bin/dig/dighost.c
bin/dig/host.c
bin/dig/include/dig/dig.h
bin/dig/nslookup.c

index ec923acdaebb6f555a9115765218e007bfa75abf..b53c44d414bf5fab9c0ccb00864ef715b064b395 100644 (file)
@@ -233,7 +233,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;
@@ -1311,11 +1311,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 ac2db2a020cb07f54ed79e18eed2ea965d6f5f1b..e02f3010189f4afb8738c3440b248ac1a43e28ec 100644 (file)
@@ -202,7 +202,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);
@@ -266,7 +266,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) {
@@ -437,7 +437,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);
@@ -3738,7 +3738,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 13800472e14a87fa8db9c6eab3202eb84a653c65..950f9a1e5629c506dcd300fd437b0d7796a8a3a1 100644 (file)
@@ -169,7 +169,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 748a0a5eade87737f3f2547689ff1ce6ba969d5a..c132efd5d9b66db7d71e26831ee22996b0cc8ce1 100644 (file)
@@ -382,7 +382,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 131c9d6b4fc1c709673401119cc088a4cfab49fc..66232bf06ab8bc1c90c39dcfcae6a09380cd3c90 100644 (file)
@@ -387,7 +387,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);
@@ -549,7 +549,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 = ");