diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-12 09:42:23 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-12 09:42:23 +0800 |
commit | 9a12adf6d29cdefc98afe2566a9e5479489f111b (patch) | |
tree | 6e2b911398cb6dcb08b183ab645817e098182968 /util/deluserfile.c | |
parent | 3d16ea67c380607528e7c8df0b2cc5a2f2636b9f (diff) | |
download | pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar.gz pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar.bz2 pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar.lz pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar.xz pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.tar.zst pttbbs-9a12adf6d29cdefc98afe2566a9e5479489f111b.zip |
* extract common functions as library.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3673 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/deluserfile.c')
-rw-r--r-- | util/deluserfile.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/util/deluserfile.c b/util/deluserfile.c index aa5aaa74..f9f16f1f 100644 --- a/util/deluserfile.c +++ b/util/deluserfile.c @@ -7,25 +7,6 @@ #define DELZEROFILE #define USERHOME BBSHOME "/home" -int bad_user_id(const char *userid) -{ - register char ch; - - if (strlen(userid) < 2) - return 1; - - if (!isalpha(*userid)) - return 1; - - if (!strcasecmp(userid, "new")) - return 1; - - while ((ch = *(++userid))) - if (!isalnum(ch)) - return 1; - return 0; -} - void del_file(char *userid) { char buf[200], buf1[200]; @@ -123,7 +104,7 @@ int main(int argc, char **argv) ptr = de->d_name; /* ¹w¨¾¿ù»~ */ - if (!bad_user_id(ptr)) + if (is_validuserid(ptr)) { if (!(count++ % 300)) printf(".\n"); |