1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-13 02:13:02 +01:00

remove unnecessary memsets

This commit is contained in:
Jfreegman 2014-07-06 03:41:48 -04:00
parent 8b6a5813e6
commit ad14baf601
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -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].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));
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);
}
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);
int i;