mirror of
https://github.com/pissnet/pissircd.git
synced 2025-07-28 14:02:27 +01:00
Tiny code cleanup in conf to use allowed_channelchars_strtoval()
This commit is contained in:
parent
d25f6f6759
commit
177d017b06
1 changed files with 2 additions and 9 deletions
11
src/conf.c
11
src/conf.c
|
@ -7817,12 +7817,7 @@ int _conf_set(ConfigFile *conf, ConfigEntry *ce)
|
|||
}
|
||||
else if (!strcmp(cep->ce_varname, "allowed-channelchars"))
|
||||
{
|
||||
if (!strcmp(cep->ce_vardata, "ascii"))
|
||||
tempiConf.allowed_channelchars = ALLOWED_CHANNELCHARS_ASCII;
|
||||
else if (!strcmp(cep->ce_vardata, "utf8"))
|
||||
tempiConf.allowed_channelchars = ALLOWED_CHANNELCHARS_UTF8;
|
||||
else if (!strcmp(cep->ce_vardata, "any"))
|
||||
tempiConf.allowed_channelchars = ALLOWED_CHANNELCHARS_ANY;
|
||||
tempiConf.allowed_channelchars = allowed_channelchars_strtoval(cep->ce_vardata);
|
||||
}
|
||||
else if (!strcmp(cep->ce_varname, "hide-idle-time"))
|
||||
{
|
||||
|
@ -9015,9 +9010,7 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
|
|||
else if (!strcmp(cep->ce_varname, "allowed-channelchars"))
|
||||
{
|
||||
CheckNull(cep);
|
||||
if (strcmp(cep->ce_vardata, "ascii") &&
|
||||
strcmp(cep->ce_vardata, "utf8") &&
|
||||
strcmp(cep->ce_vardata, "any"))
|
||||
if (!allowed_channelchars_strtoval(cep->ce_vardata))
|
||||
{
|
||||
config_error("%s:%i: set::allowed-channelchars: value should be one of: 'ascii', 'utf8' or 'any'",
|
||||
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue