Browse Source

lib: os: zvfs: select: Fix warning about bitshifting signed value

This was caught by UBSAN:

  zvfs_select.c:70:2: runtime error: left shift of 1 by 31 places
  cannot be represented in type 'int'

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
pull/91526/merge
Robert Lubos 1 week ago committed by Daniel DeGrasse
parent
commit
c7757b982c
  1. 2
      lib/os/zvfs/zvfs_select.c

2
lib/os/zvfs/zvfs_select.c

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
#define FD_SET_CALC_OFFSETS(set, word_idx, bit_mask) { \
unsigned int b_idx = fd % (sizeof(set->bitset[0]) * 8); \
word_idx = fd / (sizeof(set->bitset[0]) * 8); \
bit_mask = 1 << b_idx; \
bit_mask = 1UL << b_idx; \
}
int zvfs_poll_internal(struct zvfs_pollfd *fds, int nfds, k_timeout_t timeout);

Loading…
Cancel
Save