Use realloc because reallocarray doesn't exist for some versions of C ;-;

This commit is contained in:
indev committed 2023-08-03 11:17:04 +03:00
1 parent 746a2d4b05
commit cf9ac98ffd
1 file changed
+5
+5
View File
@@ -438,8 +438,13 @@ static void Chatlogsize_OnChange(void)
HU_removeChatText_Log();
}
// Some versons of C don't have reallocarray sadly
#define reallocarray(ptr, nmemb, size) realloc(ptr, (nmemb)*(size))
// TODO - use z_zone allocators?
chat_log = reallocarray(chat_log, cv_chatlogsize.value, sizeof(char*));
#undef reallocarray
chat_nummsg_log = min(chat_nummsg_log, (UINT32)cv_chatlogsize.value);
}
#endif