1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 22:49:01 +00:00

Cast literal to appropriate type

On 64-bit, the literal 1 is a 32-bit integer, and can't be shifted
by the appropriate amount (61 bits).
This commit is contained in:
dmiller
2013-11-29 01:42:42 +00:00
parent 39cdd05864
commit a5ce7f6083

View File

@@ -395,7 +395,7 @@ nsock_event_id get_new_event_id(mspool *ms, enum nse_type type) {
assert(type < NSE_TYPE_MAX);
shiftbits = sizeof(nsock_event_id) * 8 - TYPE_CODE_NUM_BITS;
max_serial_allowed = (1 << shiftbits) - 1;
max_serial_allowed = ((unsigned long)1 << shiftbits) - 1;
if (serial == max_serial_allowed) {
/* then the next serial will be one because 0 is forbidden */
ms->next_event_serial = 1;