Re: [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 17, 2009, 16:32 UTC
- Message-ID
- <alpine.DEB.1.00.0908171829510.4991@intel-tinevez-2-302>
- In-Reply-To
- <1250524872-5148-3-git-send-email-lznuaa@gmail.com>
Hi,
On Tue, 18 Aug 2009, Frank Li wrote:
> There are not NUL at vsnprintf verstion of MSVC when rearch max len. > Define vsnprintf to _vsnprintf. vsnprintf have deprecated.
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.
The patch is good, although I suspect that the definition of vsnprintf is better handled in the precompiler options in .vcproj.
Ciao, Dscho