diff options
author | Roger Dingledine <arma@torproject.org> | 2005-08-15 08:51:20 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-08-15 08:51:20 +0000 |
commit | 79e3f5600a9f44f4c228fac173299882076a19a8 (patch) | |
tree | 62bd9e8b1cf266894ad7c6de840d4ee07262439c /src | |
parent | 3728011f3680fc62e3af959f24f176afa7e3eb74 (diff) | |
download | tor-79e3f5600a9f44f4c228fac173299882076a19a8.tar.gz tor-79e3f5600a9f44f4c228fac173299882076a19a8.zip |
hey, we have a function for that
svn:r4781
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/or/config.c b/src/or/config.c index 24d9f8f1c5..f50133ba65 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -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; } } |