aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-10-29 00:20:43 -0400
committerTest_User <hax@andrewyu.org>2024-10-29 00:37:05 -0400
commit44c8b93d417cf23580000406f11350ca7e8b52fc (patch)
tree8d9239b03e7471c4d93f61197c88ec0a66a2da0b
parentFix some header inclusions (diff)
downloadhaxircd-master.tar.gz
haxircd-master.zip
Adjust parsing stuffHEADmaster
-rw-r--r--protocols/inspircd2.c8
-rw-r--r--protocols/inspircd3.c8
-rw-r--r--protocols/inspircd4.c8
3 files changed, 9 insertions, 15 deletions
diff --git a/protocols/inspircd2.c b/protocols/inspircd2.c
index 263f475..4a59c10 100644
--- a/protocols/inspircd2.c
+++ b/protocols/inspircd2.c
@@ -364,16 +364,14 @@ void * inspircd2_protocol_connection(void *type) {
size_t argc = 0;
size_t old_offset = offset;
while (offset < msg_len) {
- if (full_msg.data[offset] == ':') {
- argc++;
+ argc++;
+
+ if (full_msg.data[offset] == ':')
break;
- }
while (offset < msg_len && full_msg.data[offset] != ' ')
offset++;
- argc++;
-
while (offset < msg_len && full_msg.data[offset] == ' ')
offset++;
}
diff --git a/protocols/inspircd3.c b/protocols/inspircd3.c
index 258767e..8f92fb8 100644
--- a/protocols/inspircd3.c
+++ b/protocols/inspircd3.c
@@ -353,16 +353,14 @@ void * inspircd3_protocol_connection(void *type) {
size_t argc = 0;
size_t old_offset = offset;
while (offset < msg_len) {
- if (full_msg.data[offset] == ':') {
- argc++;
+ argc++;
+
+ if (full_msg.data[offset] == ':')
break;
- }
while (offset < msg_len && full_msg.data[offset] != ' ')
offset++;
- argc++;
-
while (offset < msg_len && full_msg.data[offset] == ' ')
offset++;
}
diff --git a/protocols/inspircd4.c b/protocols/inspircd4.c
index 8835b38..74f8a73 100644
--- a/protocols/inspircd4.c
+++ b/protocols/inspircd4.c
@@ -354,16 +354,14 @@ void * inspircd4_protocol_connection(void *type) {
size_t argc = 0;
size_t old_offset = offset;
while (offset < msg_len) {
- if (full_msg.data[offset] == ':') {
- argc++;
+ argc++;
+
+ if (full_msg.data[offset] == ':')
break;
- }
while (offset < msg_len && full_msg.data[offset] != ' ')
offset++;
- argc++;
-
while (offset < msg_len && full_msg.data[offset] == ' ')
offset++;
}