firewall3: Fix GCC8 warnings by replacing sprintf with snprintf
authorRosen Penev <rosenp@gmail.com>
Thu, 21 Jun 2018 23:09:56 +0000 (16:09 -0700)
committerJohn Crispin <john@phrozen.org>
Mon, 2 Jul 2018 05:19:32 +0000 (07:19 +0200)
commit72684e5bb8d3a7deb0cfdafa77b40be0b6360ccd
tree07a3ddc7ecfbfe0b14b97a0fbbefd2b46a5bfc4b
parent30463d08056db8f03d17c0569581aef96418c38d
firewall3: Fix GCC8 warnings by replacing sprintf with snprintf

error: ‘%u’ directive writing between 1 and 10 bytes into a region of size
between 7 and 11 [-Werror=format-overflow=]
sprintf(buf, "%u-%u", port->port_min, port->port_max);
                 ^~
note: directive argument in the range [0, 2147483647]
sprintf(buf, "%u-%u", port->port_min, port->port_max);
             ^~~~~~~
note: ‘sprintf’ output between 4 and 17 bytes into a destination of size
13
sprintf(buf, "%u-%u", port->port_min, port->port_max);

Signed-off-by: Rosen Penev <rosenp@gmail.com>
iptables.c
redirects.c