From 82236a2a653ea3ea242a611b94457c6beb1c85ac Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Wed, 23 Mar 2016 09:22:55 -0500 Subject: [PATCH] IRCD_BUFSIZE is redundant with BUFSIZE, so kill it. --- include/blacklist.h | 2 +- include/common.h | 3 --- include/s_conf.h | 2 +- ircd/blacklist.c | 2 +- ircd/newconf.c | 8 ++++---- ircd/s_user.c | 2 +- ircd/send.c | 4 ++-- modules/cap_server_time.c | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/include/blacklist.h b/include/blacklist.h index 652f12b4..7c8fc23e 100644 --- a/include/blacklist.h +++ b/include/blacklist.h @@ -36,7 +36,7 @@ struct Blacklist { int ipv6; /* Does this blacklist support IPv6 lookups? */ char host[IRCD_RES_HOSTLEN + 1]; rb_dlink_list filters; /* Filters for queries */ - char reject_reason[IRCD_BUFSIZE]; + char reject_reason[BUFSIZE]; unsigned int hits; time_t lastwarning; }; diff --git a/include/common.h b/include/common.h index 676b6b9c..58b52ac4 100644 --- a/include/common.h +++ b/include/common.h @@ -30,9 +30,6 @@ #define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b)) #define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b)) -/* Right out of the RFC */ -#define IRCD_BUFSIZE 512 - /* readbuf size */ #define READBUF_SIZE 16384 diff --git a/include/s_conf.h b/include/s_conf.h index 49a0d1e8..b4bd821c 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -389,7 +389,7 @@ extern int yylex(void); extern unsigned long cidr_to_bitmask[]; -extern char conffilebuf[IRCD_BUFSIZE + 1]; +extern char conffilebuf[BUFSIZE + 1]; extern int lineno; #define NOT_AUTHORISED (-1) diff --git a/ircd/blacklist.c b/ircd/blacklist.c index ae3f10ee..47438438 100644 --- a/ircd/blacklist.c +++ b/ircd/blacklist.c @@ -227,7 +227,7 @@ struct Blacklist *new_blacklist(char *name, char *reject_reason, int ipv4, int i blptr->status &= ~CONF_ILLEGAL; rb_strlcpy(blptr->host, name, IRCD_RES_HOSTLEN + 1); - rb_strlcpy(blptr->reject_reason, reject_reason, IRCD_BUFSIZE); + rb_strlcpy(blptr->reject_reason, reject_reason, BUFSIZE); blptr->ipv4 = ipv4; blptr->ipv6 = ipv6; diff --git a/ircd/newconf.c b/ircd/newconf.c index 974f798b..827f6ed9 100644 --- a/ircd/newconf.c +++ b/ircd/newconf.c @@ -2030,10 +2030,10 @@ void conf_report_error(const char *fmt, ...) { va_list ap; - char msg[IRCD_BUFSIZE + 1] = { 0 }; + char msg[BUFSIZE + 1] = { 0 }; va_start(ap, fmt); - vsnprintf(msg, IRCD_BUFSIZE, fmt, ap); + vsnprintf(msg, BUFSIZE, fmt, ap); va_end(ap); if (testing_conf) @@ -2050,10 +2050,10 @@ void conf_report_warning(const char *fmt, ...) { va_list ap; - char msg[IRCD_BUFSIZE + 1] = { 0 }; + char msg[BUFSIZE + 1] = { 0 }; va_start(ap, fmt); - vsnprintf(msg, IRCD_BUFSIZE, fmt, ap); + vsnprintf(msg, BUFSIZE, fmt, ap); va_end(ap); if (testing_conf) diff --git a/ircd/s_user.c b/ircd/s_user.c index 46a1ee61..1f6a4cb4 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -219,7 +219,7 @@ register_local_user(struct Client *client_p, struct Client *source_p) { struct ConfItem *aconf, *xconf; struct User *user = source_p->user; - char tmpstr2[IRCD_BUFSIZE]; + char tmpstr2[BUFSIZE]; char ipaddr[HOSTIPLEN]; char myusername[USERLEN+1]; int status; diff --git a/ircd/send.c b/ircd/send.c index a733f049..44cb0498 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -218,7 +218,7 @@ send_queued_write(rb_fde_t *F, void *data) static void linebuf_put_msgvbuf(struct MsgBuf *msgbuf, buf_head_t *linebuf, unsigned int capmask, const char *pattern, va_list *va) { - char buf[IRCD_BUFSIZE]; + char buf[BUFSIZE]; rb_linebuf_newbuf(linebuf); msgbuf_unparse_prefix(buf, sizeof buf, msgbuf, capmask); @@ -497,7 +497,7 @@ void sendto_channel_flags(struct Client *one, int type, struct Client *source_p, struct Channel *chptr, const char *pattern, ...) { - char buf[IRCD_BUFSIZE]; + char buf[BUFSIZE]; va_list args; buf_head_t rb_linebuf_local; buf_head_t rb_linebuf_id; diff --git a/modules/cap_server_time.c b/modules/cap_server_time.c index 3119319f..73fce017 100644 --- a/modules/cap_server_time.c +++ b/modules/cap_server_time.c @@ -52,7 +52,7 @@ mapi_cap_list_av2 cap_server_time_cap_list[] = { static void cap_server_time_process(hook_data *data) { - static char buf[IRCD_BUFSIZE]; + static char buf[BUFSIZE]; time_t ts = rb_current_time(); struct MsgBuf *msgbuf = data->arg1;