~rcr/rirc

401f46262702870d62403f1b3edd0067587a4b95 — Richard Robbins a month ago e6d3db5 dev
fix mode message error string
2 files changed, 1 insertions(+), 5 deletions(-)

M src/components/mode.h
M src/handlers/irc_recv.c
M src/components/mode.h => src/components/mode.h +0 -2
@@ 104,12 104,10 @@ struct mode_str
};

const char* mode_str(const struct mode*, struct mode_str*, enum mode_str_type);

enum mode_err mode_cfg(struct mode_cfg*, const char*, enum mode_cfg_type);
enum mode_err mode_chanmode_set(struct mode*, const struct mode_cfg*, int, int);
enum mode_err mode_prfxmode_set(struct mode*, const struct mode_cfg*, int, int);
enum mode_err mode_usermode_set(struct mode*, const struct mode_cfg*, int, int);

enum mode_type mode_type(const struct mode_cfg*, int, int);

#endif

M src/handlers/irc_recv.c => src/handlers/irc_recv.c +1 -3
@@ 872,7 872,7 @@ recv_mode(struct server *s, struct irc_message *m)
	struct channel *c;

	if (!irc_message_param(m, &targ))
		failf(s, "NICK: new nick is null");
		failf(s, "MODE: target nick is null");

	if (!strcmp(targ, s->nick))
		return recv_mode_usermodes(m, &(s->mode_cfg), s);


@@ 893,8 893,6 @@ recv_mode_chanmodes(struct irc_message *m, const struct mode_cfg *cfg, struct se
	struct mode *chanmodes = &(c->chanmodes);
	struct user *user;

	// TODO: mode string segfaults if args out of order

	if (!irc_message_param(m, &modestring)) {
		newlinef(c, 0, FROM_ERROR, "MODE: modestring is null");
		return 1;