[or-cvs] hey, we have a function for that

arma at seul.org arma at seul.org
Mon Aug 15 08:51:22 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	config.c 
Log Message:
hey, we have a function for that


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.386
retrieving revision 1.387
diff -u -d -r1.386 -r1.387
--- config.c	12 Aug 2005 17:24:53 -0000	1.386
+++ config.c	15 Aug 2005 08:51:20 -0000	1.387
@@ -1533,18 +1533,8 @@
       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;
     }
   }



More information about the tor-commits mailing list