diff options
-rw-r--r-- | mbbsd/cache.c | 1 | ||||
-rw-r--r-- | mbbsd/passwd.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 5112efe0..261cfa5f 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -203,6 +203,7 @@ getuser(char *userid) if ((uid = searchuser(userid))) passwd_query(uid, &xuser); + xuser.money = moneyof(uid); return uid; } diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index ce6cd233..d33433b5 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -95,12 +95,19 @@ passwd_query_money(int num) if ((pwdfd = open(path, O_WRONLY)) < 0) { if(passwd_index_query(num, &user)<0) // tempory code, will be removed - return -1; + return 0; return user.money; } if(lseek(pwdfd, (off_t)((int)&user.money - (int)&user), SEEK_SET) >= 0) read(pwdfd, &money, sizeof(int)); close(pwdfd); + if(money<0) + { + if(passwd_index_query(num, &user)<0) // tempory code, will be removed + return 0; + return user.money; + } + return money; } |