On 09-03-17 15:20, Antonio Quartulli wrote: > On Thu, Mar 09, 2017 at 03:00:43PM +0100, Steffan Karger wrote: >> A number of printf-like functions used incorrect format specifiers for >> Windows builds, which could potentially lead to incorrect values being >> printed / used when calling executables. >> >> Signed-off-by: Steffan Karger <steffan.kar...@fox-it.com> >> --- >> v2: add OVPN_PRI_SKT define to print socket type across platforms >> >> src/openvpn/init.c | 2 +- >> src/openvpn/route.c | 12 ++++++------ >> src/openvpn/socket.c | 7 ++++--- >> src/openvpn/syshead.h | 2 ++ >> src/openvpn/tun.c | 4 ++-- >> 5 files changed, 15 insertions(+), 12 deletions(-) >> >> diff --git a/src/openvpn/init.c b/src/openvpn/init.c >> index 033318d..2a9a398 100644 >> --- a/src/openvpn/init.c >> +++ b/src/openvpn/init.c >> @@ -1585,7 +1585,7 @@ do_open_tun(struct context *c) >> #ifdef _WIN32 >> /* store (hide) interactive service handle in tuntap_options */ >> c->c1.tuntap->options.msg_channel = c->options.msg_channel; >> - msg(D_ROUTE, "interactive service msg_channel=%u", (unsigned int) >> c->options.msg_channel); >> + msg(D_ROUTE, "interactive service msg_channel=%"PRIuPTR, (uintptr_t) >> c->options.msg_channel); > > A little comment about the style (codestyle maniac here!). > Should this: > > msg_channel=%"PRIuPTR > > be: > > msg_channel=%" PRIuPTR > > ? > > the " is closing the const char and therefore a space would be needed between > it and the > next constant. > > This appears several times in the patch and therefore I thought it was worth > mentioning it.
I don't have a strong preference about this. I tend to not add spaces for these preprocessor-format-specifiers, because I view them as part of the string. But I get your view too. So I'd be perfectly fine with adding spaces if that's the general preference. -Steffan
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel