summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-12-05 13:15:01 +0100
committerPhil Sutter <phil@nwl.cc>2019-12-06 12:12:08 +0100
commit98b221002960040bf3505811c06025b6b9b6984b (patch)
tree752bcb6d4eee7dd70a92a6ddd7aa715bec9ff6ad /extensions
parent48be21bf39f9af35d53af0e211cbd50dcfd12d08 (diff)
extensions: time: Avoid undefined shift
Value 1 is signed by default and left-shifting by 31 is undefined for those. Fix this by marking the value as unsigned. Fixes: ad326ef9f734a ("Add the libxt_time iptables match")
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libxt_time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c
index 5a8cc5de..d001f5b7 100644
--- a/extensions/libxt_time.c
+++ b/extensions/libxt_time.c
@@ -330,7 +330,7 @@ static void time_print_monthdays(uint32_t mask, bool human_readable)
printf(" ");
for (i = 1; i <= 31; ++i)
- if (mask & (1 << i)) {
+ if (mask & (1u << i)) {
if (nbdays++ > 0)
printf(",");
printf("%u", i);