diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-24 01:35:17 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-24 01:35:17 +0800 |
commit | 28c43319e7e19c98eb0048e41082cad636cc68bd (patch) | |
tree | 7ebd9ac9c072dfdf6ff127844a8224040c7ad568 /mbbsd/passwd.c | |
parent | 92036d5ff8ddca4f20146c3b229f86ef4504d77a (diff) | |
download | pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar.gz pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar.bz2 pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar.lz pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar.xz pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.tar.zst pttbbs-28c43319e7e19c98eb0048e41082cad636cc68bd.zip |
- revise passwd_apply() api, prevent use global variable to pass data.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3859 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/passwd.c')
-rw-r--r-- | mbbsd/passwd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index 15323be2..ddda6a48 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -121,14 +121,14 @@ int initcuser(const char *userid) } int -passwd_apply(int (*fptr) (int, userec_t *)) +passwd_apply(void *ctx, int (*fptr) (void *ctx, int, userec_t *)) { int i; userec_t user; for (i = 0; i < MAX_USERS; i++) { passwd_query(i + 1, &user); - if ((*fptr) (i, &user) == QUIT) - return QUIT; + if ((*fptr) (ctx, i, &user) < 0) + return -1; } return 0; } |