summaryrefslogtreecommitdiffstats
path: root/mbbsd/passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/passwd.c')
-rw-r--r--mbbsd/passwd.c9
1 files changed, 8 insertions, 1 deletions
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;
}