]> 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 <colin@isc.org>
Wed, 12 Nov 2025 10:31:28 +0000 (11:31 +0100)
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.

bin/tools/mdig.c

index 339b75644a2de929ee42f846924f0435be416c25..ddfddee46debdcb3e4f8e772e525af4c7c513e9a 100644 (file)
@@ -1594,7 +1594,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 */