]> skyeroc.xyz Git - dgamelaunch/commitdiff
replace two big conditionals with isalnum(3) calls
authorJoshua Kwan <joshk@triplehelix.org>
Sun, 4 Jan 2004 12:07:38 +0000 (12:07 +0000)
committerJoshua Kwan <joshk@triplehelix.org>
Sun, 4 Jan 2004 12:07:38 +0000 (12:07 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@76 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index 29c194e44e3cf780514b3f22baa335c88afa7120..acd136140d313f70bf2bbc28d94a52c778be2504 100644 (file)
@@ -781,11 +781,7 @@ newuser ()
 
       for (i = 0; i < strlen (buf); i++)
         {
-          if (!
-              (((buf[i] >= 'a') && (buf[i] <= 'z'))
-               || ((buf[i] >= 'A') && (buf[i] <= 'Z')) || ((buf[i] >= '0')
-                                                           && (buf[i] <=
-                                                               '9'))))
+          if (!isalnum(buf))
             error = 1;
         }
 
@@ -897,8 +893,7 @@ readfile (int nolock)
       /* name field, must be valid */
       while (*b != ':')
         {
-          if (!(((*b >= 'a') && (*b <= 'z')) || ((*b >= 'A') && (*b <= 'Z'))
-                || ((*b >= '0') && (*b <= '9'))))
+          if (!isalnum(*b))
             return 1;
           users[f_num]->username[(b - n)] = *b;
           b++;