X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Flogger.cpp;h=358b3146b3bb6e789670adc1203d0524956de764;hb=cf45ef016ce162419f74f9165c4267a184714956;hp=809670a6f86f67faf5f08c946b9ddcb82166a54c;hpb=18ba5c0014514a8248a77dd36d8ee8d9acc3227b;p=evaf
diff --git a/src/libs/Common/logger.cpp b/src/libs/Common/logger.cpp
index 809670a..358b314 100644
--- a/src/libs/Common/logger.cpp
+++ b/src/libs/Common/logger.cpp
@@ -421,11 +421,15 @@ QString Logger::printf(char const * const fmt, ...) const
va_list ap;
#ifdef Q_OS_WIN32
va_start(ap, fmt);
+# ifdef Q_CC_GNU
+ vsnprintf(str, sizeof(str), fmt, ap);
+# else
_vsnprintf_s(str, sizeof(str), _TRUNCATE, fmt, ap);
+# endif
va_end(ap);
#else
::va_start(ap, fmt);
- if (::vasprintf(&str, fmt, ap)); // IF is needed to avoid the compiler warning
+ if (::vasprintf(&str, fmt, ap)) {}; // IF is needed to avoid the compiler warning
::va_end(ap);
#endif