]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
mdig: fix implicit bool to int cast
authorColin Vidal <colin@isc.org>
Tue, 14 Oct 2025 11:31:44 +0000 (13:31 +0200)
committerColin Vidal (GitLab job 6470718) <colin@isc.org>
Wed, 12 Nov 2025 10:32:20 +0000 (10:32 +0000)
The `display_rrcomments` is a tri-state (-1, 0, 1) which is (in some
cases) initialized with `state`, a boolean, through an implicit cast.
This was spot by Coccinelle. Remove the implcit cast by explicitly
assigning 0 or 1 to `display_rrcomments` based on `state` value.

(cherry picked from commit 25f303f0466ffc821b87ca9aced5935dcaa0be21)

bin/tools/mdig.c

index 063d779f4f076f6859bbd86d122833749e9af7be..c181d4ca43680fabe80ab6ecbca74bc1f9af56be 100644 (file)
@@ -1618,7 +1618,7 @@ plus_option(char *option, struct query *query, bool global) {
                FULLCHECK("yaml");
                yaml = state;
                if (state) {
-                       display_rrcomments = state;
+                       display_rrcomments = 1;
                }
                break;
        case 'z': /* zflag */