aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-07-25 08:00:00 +0800
committerRunxi Yu <me@runxiyu.org>2024-07-25 08:00:00 +0800
commit3d39ab0475b4c55bcf63dabde86620044d5d5d7b (patch)
tree5b6bb49fcf4325caea5fc111bed7a59c69d55f87
parentba65c2e1211e3c62b80eaaf6e35d198a5110fc71 (diff)
downloadhaxircd-3d39ab0475b4c55bcf63dabde86620044d5d5d7b.tar.gz
haxircd-3d39ab0475b4c55bcf63dabde86620044d5d5d7b.zip
InspIRCd v4: Fix loop condition in FJOIN memid reset
There was a typo in the InspIRCd v3 code, in the FJOIN handler: The loop condition said n > 0, while n is never changed in the loop. It turns out the the loop condition should have been x > 0. This was fixed for InspIRCd v3 in commit 85716714, but it was not ported to the InspIRCd v4 protocol support code because the v4 code was copied from v3 a while ago. This commit fixes it.
-rw-r--r--protocols/inspircd4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/protocols/inspircd4.c b/protocols/inspircd4.c
index 24a2c37..ff807c7 100644
--- a/protocols/inspircd4.c
+++ b/protocols/inspircd4.c
@@ -1754,7 +1754,7 @@ int inspircd4_protocol_handle_fjoin(struct string source, size_t argc, struct st
return 0;
inspircd4_protocol_handle_fjoin_reset_member_ids:
- for (size_t x = n; n > 0;) {
+ for (size_t x = n; x > 0;) {
x--;
struct inspircd4_protocol_specific_user *this = users[x]->protocol_specific[INSPIRCD4_PROTOCOL];
if (members[user_count + x])