I modify a lang file and I have see that when services use
NICK_X_ILLEGAL
Nick %s is an illegal nickname and cannot be used.
with operserv svsnick command and I think that it wrong when for exemple on unreal I type /os svsnick nick-I-want-change //
services answer
-OperServ- Nick My-nick is an illegal nickname and cannot be used.
int do_svsnick(User * u)
{
char *nick = strtok(NULL, " ");
char *newnick = strtok(NULL, " ");
NickAlias *na;
char *c;
/* Only allow this if SuperAdmin is enabled */
if (!u->isSuperAdmin) {
notice_lang(s_OperServ, u, OPER_SUPER_ADMIN_ONLY);
return MOD_CONT;
}
if (!nick || !newnick) {
syntax_error(s_OperServ, u, "SVSNICK", OPER_SVSNICK_SYNTAX);
return MOD_CONT;
}
/* Truncate long nicknames to NICKMAX-2 characters */
if (strlen(newnick) > (NICKMAX - 2)) {
notice_lang(s_NickServ, u, NICK_X_TRUNCATED,
newnick, NICKMAX - 2, newnick);
newnick[NICKMAX - 2] = ' ';
}
/* Check for valid characters */
if (*newnick == '-' || isdigit(*newnick)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
return MOD_CONT;
}
#define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
if (!isvalid(*c) || isspace(*c)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, nick);
return MOD_CONT;
}
}
I think at the end you must put
#define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
if (!isvalid(*c) || isspace(*c)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
return MOD_CONT;
no ? correct me if I am wrong