2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-23 09:16:04 +01:00

Remove MSVC-specific try-except for C in Q_vsnprintf

This commit is contained in:
Alibek Omarov 2018-04-13 20:14:20 +03:00
parent 8e508cf065
commit f7a58ec04d

View File

@ -14,6 +14,7 @@ GNU General Public License for more details.
*/
#include <math.h>
#include <stdarg.h>
#include "common.h"
void Q_strnupr( const char *in, char *out, size_t size_out )
@ -561,23 +562,14 @@ int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list ar
{
size_t result;
__try
{
result = _vsnprintf( buffer, buffersize, format, args );
}
// to prevent crash while output
__except( EXCEPTION_EXECUTE_HANDLER )
{
memset( buffer, 0, buffersize );
result = -1;
}
result = vsnprintf( buffer, buffersize, format, args );
if( result < 0 || result >= buffersize )
{
buffer[buffersize - 1] = '\0';
return -1;
}
return result;
}
@ -719,4 +711,4 @@ char *va( const char *format, ... )
va_end( argptr );
return s;
}
}