From 6f39a80ec6fe9a6e2dd1c9d0e145991275678c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= Date: Wed, 9 Mar 2016 18:15:42 +0200 Subject: [PATCH] authd, m_stats: fix command table sizes There are 256 possible byte values. --- authd/authd.c | 6 +++--- authd/authd.h | 6 +++--- modules/m_stats.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/authd/authd.c b/authd/authd.c index 999258ca..298d3c4f 100644 --- a/authd/authd.c +++ b/authd/authd.c @@ -27,17 +27,17 @@ static void handle_reload(int parc, char *parv[]); static void handle_stat(int parc, char *parv[]); rb_helper *authd_helper = NULL; -authd_cmd_handler authd_cmd_handlers[255] = { +authd_cmd_handler authd_cmd_handlers[256] = { ['C'] = handle_reload, ['D'] = resolve_dns, ['S'] = handle_stat, }; -authd_stat_handler authd_stat_handlers[255] = { +authd_stat_handler authd_stat_handlers[256] = { ['D'] = enumerate_nameservers, }; -authd_reload_handler authd_reload_handlers[255] = { +authd_reload_handler authd_reload_handlers[256] = { ['D'] = reload_nameservers, }; diff --git a/authd/authd.h b/authd/authd.h index 8c731468..771f797a 100644 --- a/authd/authd.h +++ b/authd/authd.h @@ -33,8 +33,8 @@ typedef void (*authd_cmd_handler)(int parc, char *parv[]); typedef void (*authd_stat_handler)(const char *rid, const char letter); typedef void (*authd_reload_handler)(const char letter); -extern authd_cmd_handler authd_cmd_handlers[255]; -extern authd_stat_handler authd_stat_handlers[255]; -extern authd_reload_handler authd_reload_handlers[255]; +extern authd_cmd_handler authd_cmd_handlers[256]; +extern authd_stat_handler authd_stat_handlers[256]; +extern authd_reload_handler authd_reload_handlers[256]; #endif diff --git a/modules/m_stats.c b/modules/m_stats.c index b0dbc75c..ed51ac13 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -133,7 +133,7 @@ static void stats_capability(struct Client *); * C initalisers so we don't have to iterate anymore. * --Elizafox */ -static struct stats_cmd stats_cmd_table[255] = { +static struct stats_cmd stats_cmd_table[256] = { /* letter function need_oper need_admin */ ['a'] = { stats_dns_servers, 1, 1, }, ['A'] = { stats_dns_servers, 1, 1, },