s3/libads: cppcheck fix error: shiftTooManyBitsSigned: error
authorNoel Power <noel.power@suse.com>
Tue, 21 May 2019 10:52:56 +0000 (10:52 +0000)
committerNoel Power <npower@samba.org>
Wed, 29 May 2019 10:10:23 +0000 (10:10 +0000)
Squash 'Shifting signed 32-bit value by 31 bits is undefined behaviour'
error

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libads/disp_sec.c

index 15c99b67176a59a2a9bb40b2b3268cd895132d91..0b5f117788a5b3b09b4b3276f1c64f832881e813 100644 (file)
@@ -73,7 +73,7 @@ static void ads_disp_perms(uint32_t type)
        }
 
        for (i = 0; i < 32; i++) {
-               if (type & (1 << i)) {
+               if (type & ((uint32_t)1 << i)) {
                        for (j = 1; perms[j].str; j ++) {
                                if (perms[j].mask == (((unsigned) 1) << i)) {
                                        printf("\n\t%s (0x%08x)", perms[j].str, perms[j].mask);