Fix
source4/torture/raw/open.c:1009: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
source4/torture/raw/open.c:1048: 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>
/* Check some create options (these all should be ignored) */
for (i=0; i < 32; i++) {
- uint32_t create_option = (1 << i) & NTCREATEX_OPTIONS_MUST_IGNORE_MASK;
+ uint32_t create_option =
+ ((uint32_t)1 << i) & NTCREATEX_OPTIONS_MUST_IGNORE_MASK;
if (create_option == 0) {
continue;
}
not_a_directory_mask = 0;
unexpected_mask = 0;
for (i=0; i < 32; i++) {
- uint32_t create_option = 1<<i;
+ uint32_t create_option = (uint32_t)1<<i;
if (create_option & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) {
continue;
}