diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-06 07:18:32 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-06 07:18:32 +0800 |
commit | 479f91025c124cbaeca6c196367d6406c8d4af9e (patch) | |
tree | c0f331665c8686563985ccea47a3a483887ae564 | |
parent | 690882a4be349f90ee012b44591f931f9d10c477 (diff) | |
download | pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar.gz pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar.bz2 pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar.lz pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar.xz pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.tar.zst pttbbs-479f91025c124cbaeca6c196367d6406c8d4af9e.zip |
debug of money
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1703 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-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; } |