Don't left-shift by negative amount, which is UB according to C17

This commit is contained in:
mitmitmitm 2023-02-20 11:03:38 +01:00 committed by Sukchan Lee
parent 82e9016164
commit 22be888dae
1 changed files with 1 additions and 1 deletions

View File

@ -534,7 +534,7 @@ static void add_framed_route_to_trie(ogs_ipsubnet_t *route, upf_sess_t *sess)
for (i = 0; i <= nbits; i++) {
int part = i / chunk_size;
int bit = (- i - 1) % chunk_size;
int bit = (nbits - i - 1) % chunk_size;
if (!*trie)
*trie = ogs_calloc(1, sizeof(**trie));