mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 22:43:26 +01:00
remove unnecessary memsets
This commit is contained in:
parent
8b6a5813e6
commit
ad14baf601
@ -69,9 +69,6 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum)
|
|||||||
groupchats[i].peer_name_lengths = malloc(sizeof(uint16_t));
|
groupchats[i].peer_name_lengths = malloc(sizeof(uint16_t));
|
||||||
groupchats[i].oldpeer_name_lengths = malloc(sizeof(uint16_t));
|
groupchats[i].oldpeer_name_lengths = malloc(sizeof(uint16_t));
|
||||||
|
|
||||||
memset(groupchats[i].peer_names, 0, sizeof(uint8_t) * TOX_MAX_NAME_LENGTH);
|
|
||||||
memset(groupchats[i].peer_name_lengths, 0, sizeof(uint16_t));
|
|
||||||
|
|
||||||
memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, sizeof(UNKNOWN_NAME));
|
memcpy(&groupchats[i].oldpeer_names[0], UNKNOWN_NAME, sizeof(UNKNOWN_NAME));
|
||||||
groupchats[i].oldpeer_name_lengths[0] = (uint16_t) strlen(UNKNOWN_NAME);
|
groupchats[i].oldpeer_name_lengths[0] = (uint16_t) strlen(UNKNOWN_NAME);
|
||||||
|
|
||||||
@ -226,9 +223,6 @@ static void copy_peernames(int gnum, uint8_t peerlist[][TOX_MAX_NAME_LENGTH], ui
|
|||||||
exit_toxic_err("failed in copy_peernames", FATALERR_MEMORY);
|
exit_toxic_err("failed in copy_peernames", FATALERR_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(groupchats[gnum].peer_names, 0, sizeof(uint8_t) * npeers * N);
|
|
||||||
memset(groupchats[gnum].peer_name_lengths, 0, sizeof(uint16_t) * npeers);
|
|
||||||
|
|
||||||
uint16_t unknown_len = strlen(UNKNOWN_NAME);
|
uint16_t unknown_len = strlen(UNKNOWN_NAME);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user