Gert Doering has uploaded a new patch set (#2) to the change originally created by Frank Lichtenheld. ( https://gerrit.openvpn.net/c/openvpn/+/2343?usp=email )
The following approvals got outdated and were removed: Code-Review+2 by Răzvan Cojocaru Change subject: cppcheck: Add more printf-style functions ...................................................................... cppcheck: Add more printf-style functions Also fix the two issues raised by this. Change-Id: I8d081c87af0d746a5e3a2382567f04332639622a Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2343 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg41936.html Signed-off-by: Gert Doering <[email protected]> --- M dev-tools/openvpn-cppcheck-library.cfg M dev-tools/openvpn-cppcheck-windows.cfg M src/openvpn/networking_iproute2.c M src/openvpnserv/interactive.c 4 files changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/2343/2 diff --git a/dev-tools/openvpn-cppcheck-library.cfg b/dev-tools/openvpn-cppcheck-library.cfg index 0537b39..37195d8 100644 --- a/dev-tools/openvpn-cppcheck-library.cfg +++ b/dev-tools/openvpn-cppcheck-library.cfg @@ -6,6 +6,12 @@ <formatstr /> </arg> </function> + <function name="argv_printf"> + <formatstr type="printf"/> + <arg nr="2"> + <formatstr /> + </arg> + </function> <function name="buf_printf"> <formatstr type="printf"/> <arg nr="2"> diff --git a/dev-tools/openvpn-cppcheck-windows.cfg b/dev-tools/openvpn-cppcheck-windows.cfg index 932d586..dca2b07 100644 --- a/dev-tools/openvpn-cppcheck-windows.cfg +++ b/dev-tools/openvpn-cppcheck-windows.cfg @@ -2,6 +2,12 @@ <!-- Only used for the Windows run. Can't be in openvpn-cppcheck-library.cfg because it conflicts with gnu.cfg. --> <def> + <function name="MsgToEventLog"> + <formatstr type="printf"/> + <arg nr="2"> + <formatstr /> + </arg> + </function> <!-- MinGW uses GCC, so we need to handle GCC builtins. gnu.cfg has these, but we do not load it for Windows. Without this cppcheck does not understand our likely()/unlikely() macros. --> diff --git a/src/openvpn/networking_iproute2.c b/src/openvpn/networking_iproute2.c index 6c4c8f4..b079757 100644 --- a/src/openvpn/networking_iproute2.c +++ b/src/openvpn/networking_iproute2.c @@ -112,7 +112,7 @@ { struct argv argv = argv_new(); - argv_printf(&argv, "%s link set dev %s up mtu %d", iproute_path, iface, mtu); + argv_printf(&argv, "%s link set dev %s up mtu %u", iproute_path, iface, mtu); argv_msg(M_INFO, &argv); openvpn_execve_check(&argv, ctx->es, S_FATAL, "Linux ip link set failed"); diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index bddaf86..77b91e0 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -459,7 +459,7 @@ size = bytes / sizeof(*data); if ((size == 0) || (size > 4096)) /* our startup data is 1024 wchars at the moment */ { - MsgToEventLog(M_SYSERR, L"malformed startup data: %lu bytes received", size); + MsgToEventLog(M_SYSERR, L"malformed startup data: %zu bytes received", size); ReturnError(pipe, ERROR_STARTUP_DATA, L"GetStartupData", 1, &exit_event); goto err; } -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/2343?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I8d081c87af0d746a5e3a2382567f04332639622a Gerrit-Change-Number: 2343 Gerrit-PatchSet: 2 Gerrit-Owner: Frank Lichtenheld <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Răzvan Cojocaru <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
