From: Michael Braun Date: Fri, 1 May 2020 15:48:17 +0000 (+0200) Subject: utils: fix UBSAN warning in fls X-Git-Tag: v0.9.5~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea4dc28d696fb579848ba6c9cf5b042eba1d2d2d;p=thirdparty%2Fnftables.git utils: fix UBSAN warning in fls ../include/utils.h:120:5: runtime error: left shift of 1103101952 by 1 places cannot be represented in type 'int' Signed-off-by: Michael Braun Signed-off-by: Pablo Neira Ayuso --- diff --git a/include/utils.h b/include/utils.h index 647e8bbe..f45f2513 100644 --- a/include/utils.h +++ b/include/utils.h @@ -94,7 +94,7 @@ * This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static inline int fls(int x) +static inline int fls(uint32_t x) { int r = 32;