From 96d2cf936bae99ed4e48088d3ed63fd8aa33ed47 Mon Sep 17 00:00:00 2001 From: griever Date: Sat, 12 Jan 2002 22:18:48 +0000 Subject: [PATCH] MAXPARA removal --- Changes | 1 + include/common.h | 1 + src/modules/m_adminchat.c | 2 +- src/modules/m_away.c | 2 +- src/modules/m_kill.c | 2 +- src/modules/m_kline.c | 2 +- src/modules/m_nachat.c | 2 +- src/modules/m_quit.c | 2 +- src/modules/m_zline.c | 2 +- src/packet.c | 12 ++++++------ 10 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Changes b/Changes index 29107dced..a9007e029 100644 --- a/Changes +++ b/Changes @@ -1101,3 +1101,4 @@ seen. gmtime warning still there - Moved around a lot of aClient/anUser members, hopefully wont cause segfaults - Fixed res.c not managing to pass the proper type of parameter to inet_ntoa ONCE +- Lots of commands were using MAXPARA when they shouldnt have been diff --git a/include/common.h b/include/common.h index e39a62b1f..045784767 100644 --- a/include/common.h +++ b/include/common.h @@ -36,6 +36,7 @@ #ifdef PARAMH #include #endif + #if !defined(IN_ADDR) #include "sys.h" #endif diff --git a/src/modules/m_adminchat.c b/src/modules/m_adminchat.c index b2783343a..8d766221d 100644 --- a/src/modules/m_adminchat.c +++ b/src/modules/m_adminchat.c @@ -77,7 +77,7 @@ int m_adminchat_Init(int module_load) /* * We call our add_Command crap here */ - add_Command(MSG_ADMINCHAT, TOK_ADMINCHAT, m_admins, MAXPARA); + add_Command(MSG_ADMINCHAT, TOK_ADMINCHAT, m_admins, 1); return MOD_SUCCESS; } diff --git a/src/modules/m_away.c b/src/modules/m_away.c index 0dce2cddf..42e3e7b3c 100644 --- a/src/modules/m_away.c +++ b/src/modules/m_away.c @@ -71,7 +71,7 @@ DLLFUNC int Mod_Init(int module_load) int m_away_Init(int module_load) #endif { - add_Command(MSG_AWAY, TOK_AWAY, m_away, MAXPARA); + add_Command(MSG_AWAY, TOK_AWAY, m_away, 1); return MOD_SUCCESS; } diff --git a/src/modules/m_kill.c b/src/modules/m_kill.c index a7f3d2ce4..8dcb45c57 100644 --- a/src/modules/m_kill.c +++ b/src/modules/m_kill.c @@ -79,7 +79,7 @@ int m_kill_Init(int module_load) /* * We call our add_Command crap here */ - add_Command(MSG_KILL, TOK_KILL, m_kill, MAXPARA); + add_Command(MSG_KILL, TOK_KILL, m_kill, 2); return MOD_SUCCESS; } diff --git a/src/modules/m_kline.c b/src/modules/m_kline.c index d7b1bd4e0..55ea18c23 100644 --- a/src/modules/m_kline.c +++ b/src/modules/m_kline.c @@ -79,7 +79,7 @@ int m_kline_Init(int module_load) /* * We call our add_Command crap here */ - add_Command(MSG_KLINE, TOK_KLINE, m_kline, MAXPARA); + add_Command(MSG_KLINE, TOK_KLINE, m_kline, 2); return MOD_SUCCESS; } diff --git a/src/modules/m_nachat.c b/src/modules/m_nachat.c index eb0f750c7..787989695 100644 --- a/src/modules/m_nachat.c +++ b/src/modules/m_nachat.c @@ -77,7 +77,7 @@ int m_nachat_Init(int module_load) /* * We call our add_Command crap here */ - add_Command(MSG_NACHAT, TOK_NACHAT, m_nachat, MAXPARA); + add_Command(MSG_NACHAT, TOK_NACHAT, m_nachat, 1); return MOD_SUCCESS; } diff --git a/src/modules/m_quit.c b/src/modules/m_quit.c index 66795163e..5d5a77c0d 100644 --- a/src/modules/m_quit.c +++ b/src/modules/m_quit.c @@ -78,7 +78,7 @@ int m_quit_Init(int module_load) /* * We call our add_Command crap here */ - add_CommandX(MSG_QUIT, TOK_QUIT, m_quit, MAXPARA, M_UNREGISTERED|M_USER); + add_CommandX(MSG_QUIT, TOK_QUIT, m_quit, 1, M_UNREGISTERED|M_USER); return MOD_SUCCESS; } diff --git a/src/modules/m_zline.c b/src/modules/m_zline.c index 8968d1412..01784d6db 100644 --- a/src/modules/m_zline.c +++ b/src/modules/m_zline.c @@ -78,7 +78,7 @@ int m_zline_Init(int module_load) /* * We call our add_Command crap here */ - add_Command(MSG_ZLINE, TOK_ZLINE, m_zline, MAXPARA); + add_Command(MSG_ZLINE, TOK_ZLINE, m_zline, 2); } /* Is first run when server is 100% ready */ diff --git a/src/packet.c b/src/packet.c index 66829e945..bc869cfa9 100644 --- a/src/packet.c +++ b/src/packet.c @@ -138,24 +138,24 @@ void init_CommandHash(void) add_CommandX(MSG_NICK, TOK_NICK, m_nick, MAXPARA, M_UNREGISTERED|M_USER|M_SERVER); add_CommandX(MSG_JOIN, TOK_JOIN, m_join, MAXPARA, M_USER); add_Command(MSG_ISON, TOK_ISON, m_ison, 1); - add_CommandX(MSG_USER, TOK_USER, m_user, MAXPARA, M_UNREGISTERED|M_USER); - add_CommandX(MSG_PART, TOK_PART, m_part, MAXPARA, M_USER); + add_CommandX(MSG_USER, TOK_USER, m_user, 4, M_UNREGISTERED|M_USER); + add_CommandX(MSG_PART, TOK_PART, m_part, 2, M_USER); add_Command(MSG_WATCH, TOK_WATCH, m_watch, 1); add_Command(MSG_USERHOST, TOK_USERHOST, m_userhost, 1); add_Command(MSG_LUSERS, TOK_LUSERS, m_lusers, MAXPARA); - add_Command(MSG_TOPIC, TOK_TOPIC, m_topic, MAXPARA); + add_Command(MSG_TOPIC, TOK_TOPIC, m_topic, 2); add_Command(MSG_INVITE, TOK_INVITE, m_invite, MAXPARA); - add_Command(MSG_KICK, TOK_KICK, m_kick, MAXPARA); + add_Command(MSG_KICK, TOK_KICK, m_kick, 3); add_Command(MSG_WALLOPS, TOK_WALLOPS, m_wallops, 1); add_CommandX(MSG_ERROR, TOK_ERROR, m_error, MAXPARA, M_UNREGISTERED|M_SERVER); add_CommandX(MSG_PROTOCTL, TOK_PROTOCTL, m_protoctl, MAXPARA, M_UNREGISTERED|M_SERVER|M_USER); add_CommandX(MSG_SERVER, TOK_SERVER, m_server, MAXPARA, M_UNREGISTERED|M_SERVER); - add_Command(MSG_SQUIT, TOK_SQUIT, m_squit, MAXPARA); + add_Command(MSG_SQUIT, TOK_SQUIT, m_squit, 2); add_Command(MSG_WHOWAS, TOK_WHOWAS, m_whowas, MAXPARA); add_Command(MSG_LIST, TOK_LIST, m_list, MAXPARA); add_Command(MSG_NAMES, TOK_NAMES, m_names, MAXPARA); add_Command(MSG_TRACE, TOK_TRACE, m_trace, MAXPARA); - add_CommandX(MSG_PASS, TOK_PASS, m_pass, MAXPARA, M_UNREGISTERED|M_USER|M_SERVER); + add_CommandX(MSG_PASS, TOK_PASS, m_pass, 1, M_UNREGISTERED|M_USER|M_SERVER); add_Command(MSG_TIME, TOK_TIME, m_time, MAXPARA); add_Command(MSG_CONNECT, TOK_CONNECT, m_connect, MAXPARA); add_CommandX(MSG_VERSION, TOK_VERSION, m_version, MAXPARA, M_UNREGISTERED|M_USER|M_SERVER);