Ensure PrintVLen always adds a byte for trailing NULL

This commit is contained in:
Kovid Goyal 2016-06-26 08:54:13 +05:30
parent 523bf9f4eb
commit 298df07987
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -50,9 +50,9 @@ class OutputDevice : public PdfOutputDevice {
if( !pszFormat ) { PODOFO_RAISE_ERROR( ePdfError_InvalidHandle ); }
#ifdef _MSC_VER
return _vscprintf(pszFormat, args);
return _vscprintf(pszFormat, args) + 1;
#else
return vsnprintf(NULL, 0, pszFormat, args);
return vsnprintf(NULL, 0, pszFormat, args) + 1;
#endif
}