mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-01 13:36:46 +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:
@ -76,7 +76,9 @@ void cmd_accept(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[
|
||||
on_friend_added(m, friendnum, true);
|
||||
}
|
||||
|
||||
memset(&FrndRequests.request[req], 0, sizeof(struct friend_request));
|
||||
FrndRequests.request[req] = (struct friend_request) {
|
||||
0
|
||||
};
|
||||
|
||||
int i;
|
||||
|
||||
@ -322,7 +324,9 @@ void cmd_decline(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&FrndRequests.request[req], 0, sizeof(struct friend_request));
|
||||
FrndRequests.request[req] = (struct friend_request) {
|
||||
0
|
||||
};
|
||||
|
||||
int i;
|
||||
|
||||
|
Reference in New Issue
Block a user