mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-22 21:04:14 +00:00
Remove MSVC-specific try-except for C in Q_vsnprintf
This commit is contained in:
parent
8e508cf065
commit
f7a58ec04d
@ -14,6 +14,7 @@ GNU General Public License for more details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
void Q_strnupr( const char *in, char *out, size_t size_out )
|
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;
|
size_t result;
|
||||||
|
|
||||||
__try
|
result = vsnprintf( buffer, buffersize, format, args );
|
||||||
{
|
|
||||||
result = _vsnprintf( buffer, buffersize, format, args );
|
|
||||||
}
|
|
||||||
|
|
||||||
// to prevent crash while output
|
|
||||||
__except( EXCEPTION_EXECUTE_HANDLER )
|
|
||||||
{
|
|
||||||
memset( buffer, 0, buffersize );
|
|
||||||
result = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( result < 0 || result >= buffersize )
|
if( result < 0 || result >= buffersize )
|
||||||
{
|
{
|
||||||
buffer[buffersize - 1] = '\0';
|
buffer[buffersize - 1] = '\0';
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,4 +711,4 @@ char *va( const char *format, ... )
|
|||||||
va_end( argptr );
|
va_end( argptr );
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user