소스 검색

Merge pull request #107 from selfshadow/patch-1

Added missing va_end() calls
Branimir Karadžić 9 년 전
부모
커밋
708c52f452
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      include/bx/string.h

+ 2 - 0
include/bx/string.h

@@ -314,6 +314,7 @@ namespace bx
 		va_list argListCopy;
 		va_list argListCopy;
 		va_copy(argListCopy, _argList);
 		va_copy(argListCopy, _argList);
 		int32_t len = ::vsnprintf_s(_str, _count, size_t(-1), _format, argListCopy);
 		int32_t len = ::vsnprintf_s(_str, _count, size_t(-1), _format, argListCopy);
+		va_end(argListCopy);
 		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);
@@ -329,6 +330,7 @@ namespace bx
 		va_list argListCopy;
 		va_list argListCopy;
 		va_copy(argListCopy, _argList);
 		va_copy(argListCopy, _argList);
 		int32_t len = ::_vsnwprintf_s(_str, _count, size_t(-1), _format, argListCopy);
 		int32_t len = ::_vsnwprintf_s(_str, _count, size_t(-1), _format, argListCopy);
+		va_end(argListCopy);
 		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);