Forráskód Böngészése

Fixed MSVC CRT error.

Branimir Karadžić 11 éve
szülő
commit
b32146de6c
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      include/bx/string.h

+ 2 - 2
include/bx/string.h

@@ -225,7 +225,7 @@ namespace bx
 	inline int32_t vsnprintf(char* _str, size_t _count, const char* _format, va_list _argList)
 	inline int32_t vsnprintf(char* _str, size_t _count, const char* _format, va_list _argList)
 	{
 	{
 #if BX_COMPILER_MSVC
 #if BX_COMPILER_MSVC
-		int32_t len = ::vsnprintf_s(_str, _count, _count, _format, _argList);
+		int32_t len = ::vsnprintf_s(_str, _count, -1, _format, _argList);
 		return -1 == len ? ::_vscprintf(_format, _argList) : len;
 		return -1 == len ? ::_vscprintf(_format, _argList) : len;
 #else
 #else
 		return ::vsnprintf(_str, _count, _format, _argList);
 		return ::vsnprintf(_str, _count, _format, _argList);
@@ -238,7 +238,7 @@ namespace bx
 	inline int32_t vsnwprintf(wchar_t* _str, size_t _count, const wchar_t* _format, va_list _argList)
 	inline int32_t vsnwprintf(wchar_t* _str, size_t _count, const wchar_t* _format, va_list _argList)
 	{
 	{
 #if BX_COMPILER_MSVC
 #if BX_COMPILER_MSVC
-		int32_t len = ::_vsnwprintf_s(_str, _count, _count, _format, _argList);
+		int32_t len = ::_vsnwprintf_s(_str, _count, -1, _format, _argList);
 		return -1 == len ? ::_vscwprintf(_format, _argList) : len;
 		return -1 == len ? ::_vscwprintf(_format, _argList) : len;
 #elif defined(__MINGW32__)
 #elif defined(__MINGW32__)
 		return ::vsnwprintf(_str, _count, _format, _argList);
 		return ::vsnwprintf(_str, _count, _format, _argList);