mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 08:44:04 +02:00
Fix an ANSI C incompatibility.
This commit is contained in:
+5
-2
@@ -12270,12 +12270,15 @@ MA_API int ma_strappend(char* dst, size_t dstSize, const char* srcA, const char*
|
|||||||
|
|
||||||
MA_API char* ma_copy_string(const char* src, const ma_allocation_callbacks* pAllocationCallbacks)
|
MA_API char* ma_copy_string(const char* src, const ma_allocation_callbacks* pAllocationCallbacks)
|
||||||
{
|
{
|
||||||
|
size_t sz;
|
||||||
|
char* dst;
|
||||||
|
|
||||||
if (src == NULL) {
|
if (src == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t sz = strlen(src)+1;
|
sz = strlen(src)+1;
|
||||||
char* dst = (char*)ma_malloc(sz, pAllocationCallbacks);
|
dst = (char*)ma_malloc(sz, pAllocationCallbacks);
|
||||||
if (dst == NULL) {
|
if (dst == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user