mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-23 03:13:25 +01:00
Use compound literals to zero out structs instead of memset
This commit is contained in:
parent
4581dee4fc
commit
ba5ded9bc2
@ -164,7 +164,9 @@ bool init_call(Call *call)
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(call, 0, sizeof(Call));
|
||||
*call = (struct Call) {
|
||||
0
|
||||
};
|
||||
|
||||
call->status = cs_Pending;
|
||||
|
||||
|
@ -560,11 +560,14 @@ static void update_peer_list(Tox *m, uint32_t conferencenum, uint32_t num_peers,
|
||||
}
|
||||
|
||||
realloc_peer_list(chat, num_peers);
|
||||
memset(chat->peer_list, 0, num_peers * sizeof(ConferencePeer));
|
||||
|
||||
for (uint32_t i = 0; i < num_peers; ++i) {
|
||||
ConferencePeer *peer = &chat->peer_list[i];
|
||||
|
||||
*peer = (struct ConferencePeer) {
|
||||
0
|
||||
};
|
||||
|
||||
Tox_Err_Conference_Peer_Query err;
|
||||
tox_conference_peer_get_public_key(m, conferencenum, i, peer->pubkey, &err);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user