X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/ac408af6cba5a230c66186d4389e60766c3a74a4..8329f99cf921db029d92c4694e7c2ad1d7dabdc2:/modules/core/m_join.c diff --git a/modules/core/m_join.c b/modules/core/m_join.c index e9f092d..f8598d7 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -990,27 +990,36 @@ do_join_0(struct Client *client_p, struct Client *source_p) static int check_channel_name_loc(struct Client *source_p, const char *name) { + const char *p; + s_assert(name != NULL); if(EmptyString(name)) return 0; if(ConfigFileEntry.disable_fake_channels && !IsOper(source_p)) { - for(; *name; ++name) + for(p = name; *p; ++p) { - if(!IsChanChar(*name) || IsFakeChanChar(*name)) + if(!IsChanChar(*p) || IsFakeChanChar(*p)) return 0; } } else { - for(; *name; ++name) + for(p = name; *p; ++p) { - if(!IsChanChar(*name)) + if(!IsChanChar(*p)) return 0; } } + if(ConfigChannel.only_ascii_channels) + { + for(p = name; *p; ++p) + if(*p < 33 || *p > 126) + return 0; + } + return 1; }