From 5f4a5b62f43548bb961136e68e1c4e80c3da93a9 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 13 Sep 2011 16:08:05 +0100 Subject: [PATCH] Fixed ticket 123, Visual C++ warnings --- glm/gtx/string_cast.inl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl index c244ef56..e94d0339 100644 --- a/glm/gtx/string_cast.inl +++ b/glm/gtx/string_cast.inl @@ -15,7 +15,7 @@ namespace detail { GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) { - const int STRING_BUFFER = 4096; + std::size_t const STRING_BUFFER(4096); char text[STRING_BUFFER]; va_list list; @@ -23,7 +23,12 @@ namespace detail return std::string(); va_start(list, msg); +// Ticket #123 +#if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER_VC >= GLM_COMPILER_VC2005)) + vsprintf_s(text, msg, list, STRING_BUFFER); +#else// vsprintf(text, msg, list); +#endif// va_end(list); return std::string(text);