Re: [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git
- From
Frank Li <lznuaa@gmail.com>
- Date
- Aug 18, 2009, 01:19 UTC
- Message-ID
- <1976ea660908171819m38d3524ud174a7e76a171e75@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.1.00.0908171829510.4991@intel-tinevez-2-302>
Show 9 quoted lines
> How about this instead? > > Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++ > > The Microsoft C runtime's vsnprintf function does not add NUL at > the end of the buffer. > > Further, Microsoft deprecated vsnprintf in favor of _vsnprintf, so > add a #define to that end.
Of course, do you need me change commit comment and resend patch?
> > The patch is good, although I suspect that the definition of vsnprintf is > better handled in the precompiler options in .vcproj. >
If define in .vcproj, it needs copy that to DEBUG\RELEASE and 32bit\64bit (2x2) 4 places. It is easy to miss one.
> Ciao, > Dscho >