From 8a442e1c1e023674737d497101f365e994eebc16 Mon Sep 17 00:00:00 2001 From: Michael Ortmann Date: Wed, 29 May 2024 03:14:09 +0200 Subject: [PATCH 1/3] Cleanup remparty() --- src/botnet.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/botnet.c b/src/botnet.c index bb6b4aad3..455dc2c32 100644 --- a/src/botnet.c +++ b/src/botnet.c @@ -341,17 +341,8 @@ void remparty(char *bot, int sock) nfree(party[i].from); if (party[i].away) nfree(party[i].away); - if (i < parties) { - strcpy(party[i].bot, party[parties].bot); - strcpy(party[i].nick, party[parties].nick); - party[i].chan = party[parties].chan; - party[i].sock = party[parties].sock; - party[i].flag = party[parties].flag; - party[i].status = party[parties].status; - party[i].timer = party[parties].timer; - party[i].from = party[parties].from; - party[i].away = party[parties].away; - } + if (i < parties) + memcpy(&party[i], &party[parties], sizeof(party_t)); } } From 9fc62e565d8e227fe3dd6b9734a44957e6998cd5 Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:06:30 +0200 Subject: [PATCH 2/3] C can do --- src/botnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botnet.c b/src/botnet.c index 455dc2c32..93f2e4eca 100644 --- a/src/botnet.c +++ b/src/botnet.c @@ -342,7 +342,7 @@ void remparty(char *bot, int sock) if (party[i].away) nfree(party[i].away); if (i < parties) - memcpy(&party[i], &party[parties], sizeof(party_t)); + party[i] = party[parties]; } } From b922396b1c0fff112240850b7abac85aa7db5c69 Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Sun, 2 Jun 2024 23:15:26 +0200 Subject: [PATCH 3/3] Also here --- src/dccutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dccutil.c b/src/dccutil.c index 24cb43cfd..89832fb41 100644 --- a/src/dccutil.c +++ b/src/dccutil.c @@ -364,7 +364,7 @@ void removedcc(int n) nfree(dcc[n].u.other); dcc_total--; if (n < dcc_total) - memcpy(&dcc[n], &dcc[dcc_total], sizeof(struct dcc_t)); + dcc[n] = dcc[dcc_total]; else egg_bzero(&dcc[n], sizeof(struct dcc_t)); /* drummer */ }