tcpproxy: fix Wformat warning
authorRosen Penev <rosenp@gmail.com>
Mon, 28 Feb 2022 07:19:49 +0000 (23:19 -0800)
committerRosen Penev <rosenp@gmail.com>
Thu, 3 Mar 2022 22:21:24 +0000 (14:21 -0800)
snprintf call requires one more byte for NULL termunator.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/tcpproxy/Makefile
net/tcpproxy/patches/010-format.patch [new file with mode: 0644]

index e56e8ad87a73ea6deb3a31b86f538eac3d8e8982..0fc0364029feb036344a18f8b8e19738d5588964 100644 (file)
@@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpproxy
 PKG_VERSION:=1.2
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
diff --git a/net/tcpproxy/patches/010-format.patch b/net/tcpproxy/patches/010-format.patch
new file mode 100644 (file)
index 0000000..a681999
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/log.c
++++ b/src/log.c
+@@ -244,7 +244,7 @@ void log_print_hex_dump(log_prio_t prio,
+     for(i=0; i < len; i++) {
+       if(((i+1)*3) >= (MSG_LENGTH_MAX - offset))
+         break;
+-      snprintf(ptr, 3, "%02X ", buf[i]);
++      snprintf(ptr, 4, "%02X ", buf[i]);
+       ptr+=3;
+     }
+   }