Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
2ee92057
Commit
2ee92057
authored
Apr 25, 2025
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to fix an error with ma_log_postv().
Public issue
https://github.com/mackron/miniaudio/issues/980
parent
a944e193
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
miniaudio.h
miniaudio.h
+13
-10
No files found.
miniaudio.h
View file @
2ee92057
...
@@ -13475,6 +13475,14 @@ static ma_result ma_allocation_callbacks_init_copy(ma_allocation_callbacks* pDst
...
@@ -13475,6 +13475,14 @@ static ma_result ma_allocation_callbacks_init_copy(ma_allocation_callbacks* pDst
Logging
Logging
**************************************************************************************************************************************************************/
**************************************************************************************************************************************************************/
#ifndef ma_va_copy
#if !defined(_MSC_VER) || _MSC_VER >= 1800
#define ma_va_copy(dst, src) va_copy((dst), (src))
#else
#define ma_va_copy(dst, src) ((dst) = (src))
#endif
#endif
MA_API const char* ma_log_level_to_string(ma_uint32 logLevel)
MA_API const char* ma_log_level_to_string(ma_uint32 logLevel)
{
{
switch (logLevel)
switch (logLevel)
...
@@ -13715,9 +13723,12 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
...
@@ -13715,9 +13723,12 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
int length;
int length;
char pFormattedMessageStack[1024];
char pFormattedMessageStack[1024];
char* pFormattedMessageHeap = NULL;
char* pFormattedMessageHeap = NULL;
va_list args2;
ma_va_copy(args2, args);
/* First try formatting into our fixed sized stack allocated buffer. If this is too small we'll fallback to a heap allocation. */
/* First try formatting into our fixed sized stack allocated buffer. If this is too small we'll fallback to a heap allocation. */
length = vsnprintf(pFormattedMessageStack, sizeof(pFormattedMessageStack), pFormat, args);
length = vsnprintf(pFormattedMessageStack, sizeof(pFormattedMessageStack), pFormat, args
2
);
if (length < 0) {
if (length < 0) {
return MA_INVALID_OPERATION; /* An error occurred when trying to convert the buffer. */
return MA_INVALID_OPERATION; /* An error occurred when trying to convert the buffer. */
}
}
...
@@ -13758,15 +13769,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
...
@@ -13758,15 +13769,7 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
char* pFormattedMessage = NULL;
char* pFormattedMessage = NULL;
va_list args2;
va_list args2;
#if _MSC_VER >= 1800
ma_va_copy(args2, args);
{
va_copy(args2, args);
}
#else
{
args2 = args;
}
#endif
formattedLen = ma_vscprintf(&pLog->allocationCallbacks, pFormat, args2);
formattedLen = ma_vscprintf(&pLog->allocationCallbacks, pFormat, args2);
va_end(args2);
va_end(args2);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment