summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorC. McEnroe2020-03-23 13:13:43 -0400
committerC. McEnroe2020-03-23 13:25:10 -0400
commitcf1545870af2de418a6bccd4461f92330dc2f605 (patch)
tree48f674ba07d1d7e8fd223bc357abdf645b441803 /handle.c
parent3bb3a114542d3ac661bc49bd00d296695d5a4979 (diff)
Assume worst case for unknown user and host in splitMessage
The default USERLEN of 9 doesn't have a great source, the RFC only says
that nicks are length 9, so my assumption is that usernames are not
longer.
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index f079c00..376e722 100644
--- a/handle.c
+++ b/handle.c
@@ -238,6 +238,12 @@ static void handleReplyISupport(struct Message *msg) {
 				Network, Cold, tagTime(msg),
 				"You arrive in %s", msg->params[i]
 			);
+		} else if (!strcmp(key, "USERLEN")) {
+			if (!msg->params[i]) continue;
+			network.userLen = strtoul(msg->params[i], NULL, 10);
+		} else if (!strcmp(key, "HOSTLEN")) {
+			if (!msg->params[i]) continue;
+			network.hostLen = strtoul(msg->params[i], NULL, 10);
 		} else if (!strcmp(key, "CHANTYPES")) {
 			if (!msg->params[i]) continue;
 			set(&network.chanTypes, msg->params[i]);