Hi,

> From a technical point of view, it looks like a fine patch.  But it is hard 
> for me
> (as a non-Windows dev) to understand *why* this is needed.
> It would be good to explain the rationale for a change so others can
> understand it as quickly as possible.

snwprintf() is not defined in Windows SDK. _snwprintf() is. 
[https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l]

Mingw probably accepts both. That's why nobody noticed. Looking around OpenVPN 
code, I have found some code using _snwprintf(), some snwprintf(). Probably, 
since MSVC was neglected for so long, nobody paid attention to such a subtle 
difference.

For the code to compile on MSVC all snwprintf() should be replaced with 
_snwprintf(). Or, since the prefix underscore imposed by Windows SDK is not 
mostly aesthetical, the following #define could be introduced:
#ifdef _MSVC_VER
#define snwprintf _snwprintf
#endif

Nevertheless, I suggest consistent use of snwprintf/_snwprintf.

> I won't dive deep into how to write good commit messages here, as this blog
> post covers it very well: <https://chris.beams.io/posts/git-commit/>

Please apologize. I'll learn. Thank you for pointing me in the right 
direction.

Best regards,
Simon

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to