Skip to content
Permalink
Browse files

Remove magic numbers

  • Loading branch information
vanosg committed Oct 28, 2019
1 parent efa7313 commit 3773f137ddf71996a9ec2d359abaaef5efaeada2
Showing with 14 additions and 14 deletions.
  1. +9 −9 src/mod/server.mod/server.c
  2. +1 −1 src/mod/server.mod/server.h
  3. +4 −4 src/mod/server.mod/tclserv.c
@@ -83,8 +83,8 @@ static int double_server;
static int double_help;
static int double_warned;
static int lastpingtime; /* IRCnet LAGmeter support -- drummer */
static char stackablecmds[511];
static char stackable2cmds[511];
static char stackablecmds[MSGMAX];
static char stackable2cmds[MSGMAX];
static time_t last_time;
static int use_penalties;
static int use_fastdeq;
@@ -431,7 +431,7 @@ static int fast_deq(int which)
{
struct msgq_head *h;
struct msgq *m, *nm;
char msgstr[511], nextmsgstr[511], tosend[511], victims[511], stackable[511],
char msgstr[MSGMAX], nextmsgstr[MSGMAX], tosend[MSGMAX], victims[MSGMAX], stackable[MSGMAX],
*msg, *nextmsg, *cmd, *nextcmd, *to, *nextto, *stckbl;
int len, doit = 0, found = 0, cmd_count = 0, stack_method = 1;

@@ -557,7 +557,7 @@ static void check_queues(char *oldnick, char *newnick)
static void parse_q(struct msgq_head *q, char *oldnick, char *newnick)
{
struct msgq *m, *lm = NULL;
char buf[511], *msg, *nicks, *nick, *chan, newnicks[511], newmsg[511];
char buf[MSGMAX], *msg, *nicks, *nick, *chan, newnicks[MSGMAX], newmsg[MSGMAX];
int changed;

for (m = q->head; m;) {
@@ -613,8 +613,8 @@ static void parse_q(struct msgq_head *q, char *oldnick, char *newnick)
static void purge_kicks(struct msgq_head *q)
{
struct msgq *m, *lm = NULL;
char buf[511], *reason, *nicks, *nick, *chan, newnicks[511],
newmsg[511], chans[511], *chns, *ch;
char buf[MSGMAX], *reason, *nicks, *nick, *chan, newnicks[MSGMAX],
newmsg[MSGMAX], chans[MSGMAX], *chns, *ch;
int changed, found;
struct chanset_t *cs;

@@ -682,8 +682,8 @@ static int deq_kick(int which)
{
struct msgq_head *h;
struct msgq *msg, *m, *lm;
char buf[511], buf2[511], *reason2, *nicks, *chan, *chan2, *reason, *nick,
newnicks[511], newnicks2[511], newmsg[511];
char buf[MSGMAX], buf2[MSGMAX], *reason2, *nicks, *chan, *chan2, *reason, *nick,
newnicks[MSGMAX], newnicks2[MSGMAX], newmsg[MSGMAX];
int changed = 0, nr = 0;

if (!optimize_kicks)
@@ -822,7 +822,7 @@ static void queue_server(int which, char *msg, int len)
struct msgq_head *h = NULL, tempq;
struct msgq *q, *tq, *tqq;
int doublemsg = 0, qnext = 0;
char buf[511];
char buf[MSGMAX];

/* Don't even BOTHER if there's no server online. */
if (serv < 0)
@@ -25,7 +25,7 @@

#define CAPMAX 499 /* (512 - "CAP REQ :XXX\r\n") */
#define TAGMAX 8191 /* Max size for IRCv3 message-tags */
#define MSGMAX 512 /* Max size of IRC message line */
#define MSGMAX 511 /* Max size of IRC message line */

#define check_tcl_ctcp(a,b,c,d,e,f) check_tcl_ctcpr(a,b,c,d,e,f,H_ctcp)
#define check_tcl_ctcr(a,b,c,d,e,f) check_tcl_ctcpr(a,b,c,d,e,f,H_ctcr)
@@ -33,7 +33,7 @@ static int tcl_isbotnick STDVAR
static int tcl_putnow STDVAR
{
int len;
char buf[512], *p, *q, *r;
char buf[MSGMAX], *p, *q, *r;

BADARGS(2, 3, " text ?options?");

@@ -83,7 +83,7 @@ static int tcl_putnow STDVAR

static int tcl_putquick STDVAR
{
char s[511], *p;
char s[MSGMAX], *p;

BADARGS(2, 3, " text ?options?");

@@ -110,7 +110,7 @@ static int tcl_putquick STDVAR

static int tcl_putserv STDVAR
{
char s[511], *p;
char s[MSGMAX], *p;

BADARGS(2, 3, " text ?options?");

@@ -137,7 +137,7 @@ static int tcl_putserv STDVAR

static int tcl_puthelp STDVAR
{
char s[511], *p;
char s[MSGMAX], *p;

BADARGS(2, 3, " text ?options?");

0 comments on commit 3773f13

Please sign in to comment.
You can’t perform that action at this time.