diff mbox series

fw3: rules: fix parsing of multiple weekdays

Message ID 20200923220836.18537-1-facboy@gmail.com
State New
Headers show
Series fw3: rules: fix parsing of multiple weekdays | expand

Commit Message

Christopher Ng Sept. 23, 2020, 10:08 p.m. UTC
fw3 was not parsing the 'weekdays' option of rules correctly, it would
only put the first day listed into the iptables --weekdays option.

Signed-off-by: Christopher Ng <facboy@gmail.com>
---
 iptables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/iptables.c b/iptables.c
index e7e8b59..9e8fa74 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1208,7 +1208,7 @@  fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct fw3_time *time)
 					rem--;
 				}
 
-				p += snprintf(p, rem, "%u", i);
+				len = snprintf(p, rem, "%u", i);
 
 				if (len < 0 || len >= rem)
 					break;