From 3a5bfa9f9bc8239bb81973ffbaa1a81e8b757ccc Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 14 Jul 2021 17:20:49 +1000 Subject: [PATCH] Fix some strict C89 issues. --- miniaudio.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index e3de1979..4e2bb8ee 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -8773,7 +8773,9 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat */ #if defined(_MSC_VER) && _MSC_VER >= 1200 /* 1200 = VC6 */ { + ma_result result; int formattedLen; + char* pFormattedMessage = NULL; va_list args2; #if _MSC_VER >= 1800 @@ -8793,15 +8795,11 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat return MA_INVALID_OPERATION; } - char* pFormattedMessage = NULL; - pFormattedMessage = (char*)ma_malloc(formattedLen + 1, &pLog->allocationCallbacks); if (pFormattedMessage == NULL) { return MA_OUT_OF_MEMORY; } - ma_result result; - /* We'll get errors on newer versions of Visual Studio if we try to use vsprintf(). */ #if _MSC_VER >= 1400 /* 1400 = Visual Studio 2005 */ {