hey, we have a function for that

svn:r4781
This commit is contained in:
Roger Dingledine 2005-08-15 08:51:20 +00:00
parent 3728011f36
commit 79e3f5600a

View File

@ -1533,18 +1533,8 @@ options_validate(or_options_t *options)
log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname);
}
} else {
if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
strlen(options->Nickname)) {
log_fn(LOG_WARN, "Nickname '%s' contains illegal characters.", options->Nickname);
result = -1;
}
if (strlen(options->Nickname) == 0) {
log_fn(LOG_WARN, "Nickname must have at least one character");
result = -1;
}
if (strlen(options->Nickname) > MAX_NICKNAME_LEN) {
log_fn(LOG_WARN, "Nickname '%s' has more than %d characters.",
options->Nickname, MAX_NICKNAME_LEN);
if (!is_legal_nickname(options->Nickname)) {
log_fn(LOG_WARN, "Nickname '%s' is wrong length or contains illegal characters.", options->Nickname);
result = -1;
}
}