]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/logger.cpp
Moved setting initial root and bin directories to the Env::init() function. The Env...
[evaf] / src / libs / Common / logger.cpp
index 98d37708cc4f4630a15c8a5c6d86a92d4a268c05..8ccb0139fcd20a7285cb801c8c907f1f6ab8dfd8 100644 (file)
@@ -382,13 +382,15 @@ QString Logger::printf(char const * const fmt, ...) const
 #endif
 
     va_list ap;
-    ::va_start(ap, fmt);
 #ifdef Q_OS_WIN32
+    va_start(ap, fmt);
     _vsnprintf_s(str, sizeof(str), _TRUNCATE, fmt, ap);
+    va_end(ap);
 #else
+    ::va_start(ap, fmt);
     if (::vasprintf(&str, fmt, ap)); // IF is needed to avoid the compiler warning
-#endif
     ::va_end(ap);
+#endif
 
     QString rval(str);