1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-02 03:16:45 +02:00

Use compound literals to zero out structs instead of memset

This is cleaner and much less prone to bugs
This commit is contained in:
jfreegman
2020-11-10 21:25:27 -05:00
parent 752fc6d619
commit 68e1ba312d
15 changed files with 120 additions and 86 deletions

View File

@ -1008,7 +1008,10 @@ static void realloc_calls(uint32_t n)
void init_friend_AV(uint32_t index)
{
realloc_calls(CallControl.max_calls + 1);
memset(&CallControl.calls[CallControl.max_calls], 0, sizeof(Call));
CallControl.calls[CallControl.max_calls] = (Call) {
0
};
if (index == CallControl.max_calls) {
++CallControl.max_calls;