From e2ee3f8943140df2e52c9778fe43feb544cda977 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 22 May 2019 13:15:19 +0000 Subject: [PATCH] s3/rpcclient: cppcheck: Fix shiftTooManyBitsSigned error 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 Reviewed-by: Andreas Schneider --- source3/rpcclient/cmd_srvsvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c index 2dec0400446..9c000608463 100644 --- a/source3/rpcclient/cmd_srvsvc.c +++ b/source3/rpcclient/cmd_srvsvc.c @@ -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 "); -- 2.47.3