]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/rpcclient: cppcheck: Fix shiftTooManyBitsSigned error
authorNoel Power <noel.power@suse.com>
Wed, 22 May 2019 13:15:19 +0000 (13:15 +0000)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 4 Jun 2019 22:13:07 +0000 (22:13 +0000)
Fixes

source3/rpcclient/cmd_srvsvc.c:44: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]

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

index 2dec04004466a062eb3d6304712283b1e93f75dd..9c000608463b8a528db5aa329b2beafa821f3a6b 100644 (file)
@@ -41,7 +41,7 @@ static char *get_server_type_str(uint32_t type)
        typestr[0] = 0;
 
        for (i = 0; i < 32; i++) {
-               if (type & (1 << i)) {
+               if (type & ((uint32_t)1 << i)) {
                        switch (1 << i) {
                        case SV_TYPE_WORKSTATION:
                                fstrcat(typestr, "Wk ");