diff options
author | Selva Nair | 2018-02-21 23:54:55 -0500 |
---|---|---|
committer | Gert Doering | 2018-02-22 16:26:25 +0100 |
commit | 06ad53e067d9a8be571a27f44005fa7e8038f69e (patch) | |
tree | befc960d260aeb596c8dc68b0660c9ea6ccf22c1 /src/openvpn/forward.c | |
parent | 7bba4007824cc7fe7ba487210222b546de9269f0 (diff) | |
download | openvpn-06ad53e067d9a8be571a27f44005fa7e8038f69e.zip openvpn-06ad53e067d9a8be571a27f44005fa7e8038f69e.tar.gz |
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>
Diffstat (limited to 'src/openvpn/forward.c')
-rw-r--r-- | src/openvpn/forward.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index b5b9684..7d9a338 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -610,7 +610,7 @@ check_coarse_timers_dowork(struct context *c) process_coarse_timers(c); c->c2.coarse_timer_wakeup = now + c->c2.timeval.tv_sec; - dmsg(D_INTERVAL, "TIMER: coarse timer wakeup %lld seconds", (long long)c->c2.timeval.tv_sec); + dmsg(D_INTERVAL, "TIMER: coarse timer wakeup %"PRIi64" seconds", (int64_t)c->c2.timeval.tv_sec); /* Is the coarse timeout NOT the earliest one? */ if (c->c2.timeval.tv_sec > save.tv_sec) |