degesch: add an assertion
It should never fail with current code.
This commit is contained in:
parent
773d14e740
commit
f57664ddd0
|
@ -5325,9 +5325,13 @@ mode_processor_do_user (struct mode_processor *self)
|
||||||
|| !(channel_user = irc_channel_get_user (self->channel, user)))
|
|| !(channel_user = irc_channel_get_user (self->channel, user)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Translate mode character to user prefix character
|
||||||
const char *all_prefixes = self->s->irc_chanuser_prefixes;
|
const char *all_prefixes = self->s->irc_chanuser_prefixes;
|
||||||
const char *all_modes = self->s->irc_chanuser_modes;
|
const char *all_modes = self->s->irc_chanuser_modes;
|
||||||
char prefix = all_prefixes[strchr (all_modes, self->mode_char) - all_modes];
|
|
||||||
|
const char *mode = strchr (all_modes, self->mode_char);
|
||||||
|
hard_assert (mode && (size_t) (mode - all_modes) < strlen (all_prefixes));
|
||||||
|
char prefix = all_prefixes[mode - all_modes];
|
||||||
|
|
||||||
struct str *prefixes = &channel_user->prefixes;
|
struct str *prefixes = &channel_user->prefixes;
|
||||||
const char *pos = strchr (prefixes->str, prefix);
|
const char *pos = strchr (prefixes->str, prefix);
|
||||||
|
|
Loading…
Reference in New Issue