[trunk] Fix compilation on VS2010 (snprintf is not C89). C++11 should avoid this in the future

This commit is contained in:
Mathieu Malaterre 2014-03-13 11:03:05 +00:00
parent 320784659d
commit f0a2fdd508
1 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,9 @@ static int writeoutput( const char *fn, FILE *ppm, int X, int Y, int bpp )
/* write single comp as PGM: P5 */
for( i = 0; i < 3; ++i )
{
#ifdef _MSC_VER
#define snprintf _snprintf /* Visual Studio */
#endif
snprintf( outfn, sizeof(outfn), "%s.%s.pgm", fn, exts[i] );
outf[i] = fopen( outfn, "wb" );
if( !outf[i] ) goto cleanup;