From 946e7784b00c9051013b996bd09dcaf144cf250c Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 21 Feb 2009 17:55:12 +0000 Subject: [PATCH] Make explicit how long the arrays for prefix_add and prefix_del are. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5020 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/modes.c | 4 ++-- src/irc/core/modes.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index f204c801..3b1e7d21 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -59,7 +59,7 @@ static void nick_mode_change(IRC_CHANNEL_REC *channel, const char *nick, channel, nickrec, setby, modestr, typestr); } -void prefix_add(char *prefixes, char newprefix, SERVER_REC *server) +void prefix_add(char prefixes[MAX_USER_PREFIXES+1], char newprefix, SERVER_REC *server) { const char *prefixlst; char newprefixes[MAX_USER_PREFIXES+1]; /* to hold the new prefixes */ @@ -101,7 +101,7 @@ void prefix_add(char *prefixes, char newprefix, SERVER_REC *server) strcpy(prefixes, newprefixes); } -void prefix_del(char *prefixes, char oldprefix) +void prefix_del(char prefixes[MAX_USER_PREFIXES+1], char oldprefix) { char *todel; diff --git a/src/irc/core/modes.h b/src/irc/core/modes.h index e9326c7a..bef017ba 100644 --- a/src/irc/core/modes.h +++ b/src/irc/core/modes.h @@ -2,6 +2,7 @@ #define __MODES_H #include "irc-channels.h" +#include "nicklist.h" /* MAX_USER_PREFIXES */ typedef void mode_func_t(IRC_CHANNEL_REC *, const char *, char, char, char *, GString *); @@ -54,8 +55,8 @@ void channel_set_singlemode(IRC_CHANNEL_REC *channel, const char *nicks, void channel_set_mode(IRC_SERVER_REC *server, const char *channel, const char *mode); -void prefix_add(char *prefixes, char newprefix, SERVER_REC *server); -void prefix_del(char *prefixes, char oldprefix); +void prefix_add(char prefixes[MAX_USER_PREFIXES+1], char newprefix, SERVER_REC *server); +void prefix_del(char prefixes[MAX_USER_PREFIXES+1], char oldprefix); mode_func_t modes_type_a; mode_func_t modes_type_b;