]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix format spec errors in Windows builds
authorSelva Nair <selva.nair@gmail.com>
Thu, 22 Feb 2018 04:54:55 +0000 (23:54 -0500)
committerGert Doering <gert@greenie.muc.de>
Thu, 22 Feb 2018 15:26:25 +0000 (16:26 +0100)
commit06ad53e067d9a8be571a27f44005fa7e8038f69e
treebefc960d260aeb596c8dc68b0660c9ea6ccf22c1
parent7bba4007824cc7fe7ba487210222b546de9269f0
Fix format spec errors in Windows builds

- "%ll" is not supported by Windows run time, so use PRIi64
   and cast the variable to (int64_t) in output statements
   (as in commit 9ba36639abcac4367c8227d2dd87b18fb56267c4)

- Fix an instance of wchar_t * printed using %s -- should be %ls.

- Cast variables to int or unsigned int to match the output
  format spec when necessary.

- In route.c correct format of adapter_index (should be %lu) in a few
  places and remove some unnecessary casts to (unsigned int). Not
  all such instances are changed, only those related to adapter_index
  (for consistency) or close-by contexts are edited.

Most of these errors are seen in current Windows cross-compile,
but a few are triggered only if some DEBUG options are enabled.
Some are not in Windows specific paths. But for consistency, all uses
of %llu/%lld are removed. As these only affect log output, there are
no potential side effects.

Replacing long long by int64_t also has the advantage of avoiding
size ambiguity as long long is not guaranteed to be 64 bytes.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1519275295-29121-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16522.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
14 files changed:
src/openvpn/error.c
src/openvpn/event.c
src/openvpn/forward.c
src/openvpn/misc.c
src/openvpn/multi.c
src/openvpn/otime.c
src/openvpn/packet_id.c
src/openvpn/reliable.c
src/openvpn/route.c
src/openvpn/shaper.c
src/openvpn/shaper.h
src/openvpn/socket.c
src/openvpn/ssl_openssl.c
src/openvpn/tun.c