]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/torture: fix compilation in smb2/multichannel
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 14 Jul 2020 10:49:51 +0000 (22:49 +1200)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2020 07:16:31 +0000 (07:16 +0000)
GCC 9.3.0 doesn't like a true array being compared to NULL.

[3628/3972] Compiling source4/torture/smb2/multichannel.c
../../source4/torture/smb2/multichannel.c:1077:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
                if (trees2 == NULL || trees2[i] == NULL) {
                    ^~~~~~    ~~~~
../../source4/torture/smb2/multichannel.c:1284:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
                if (trees2 == NULL || trees2[i] == NULL) {
                    ^~~~~~    ~~~~
../../source4/torture/smb2/multichannel.c:2337:7: error: comparison of array 'trees2' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
                if (trees2 == NULL || trees2[i] == NULL) {
                    ^~~~~~    ~~~~
3 errors generated.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jul 17 07:16:31 UTC 2020 on sn-devel-184

source4/torture/smb2/multichannel.c

index 7ff1945c316d83a5d93401277b2ad1c649146de0..332ee50382e0db49301325d1ea00c8f0bbee0bcc 100644 (file)
@@ -1074,7 +1074,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);
@@ -1281,7 +1281,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);
@@ -2334,7 +2334,7 @@ done:
        smb2_deltree(tree1, BASEDIR);
 
        for (i = 0; i < ARRAY_SIZE(trees2); i++) {
-               if (trees2 == NULL || trees2[i] == NULL) {
+               if (trees2[i] == NULL) {
                        continue;
                }
                TALLOC_FREE(trees2[i]);