David Sommerseth ha scritto: > On 05/01/11 14:21, Samuli Seppänen wrote: > > This fixes a generic Windows/VC++ issue: > > > > <http://thedailyreviewer.com/dotnet/view/strncasecmp-and-snprintf-functions-not-available-in-vc-109235975> > > > Does this change affect the automake/gcc-based Windows builds? > > > I'm leaning towards a NAK on this one, as it might influence > non-Visual C builds. OpenVPN have openvpn_snprintf() which is a > portable snprintf() function, and this one should be used instead. It's > found in buffer.[ch]. > > > kind regards, > > David Sommerseth Yep, this is not an optimal solution. Some clarifications based on IRC discussions.... openvpnserv.c uses it's own snprintf wrapper function (=mysnprintf) extensively. My modification changed snprintf into _snprintf inside this wrapper function. I assume mysnprintf is used instead of openvpn_snprintf (in buffer.c) to avoid dependency to openvpn at code level. If we want to use openvpn_snprintf instead of mysnprintf, I think we should change all references to mysnprintf into references to openvpn_snprintf. This would avoid "double-wrapping" snprintf.
For your convenience, here are mysnprintf (with my _snprintf modification) and openvpn_snprintf from buffer.c: http://pastie.org/1431115 -- Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock PS.. I sure learned how to write snprintf when writing this mail :D