diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-09-11 13:03:52 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-09-11 13:03:52 +0800 |
commit | 04d7d939d521b585369ff7cb072a1f4e71849e9d (patch) | |
tree | 2965291c73384abf446a94961b77212035b984e0 | |
parent | 20e520708906a428f8aad674e9197d4d0ed5ce65 (diff) | |
download | pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar.gz pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar.bz2 pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar.lz pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar.xz pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.tar.zst pttbbs-04d7d939d521b585369ff7cb072a1f4e71849e9d.zip |
code cleanup
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/guess.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/guess.c b/mbbsd/guess.c index ece753b4..5ec40080 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -1,4 +1,4 @@ -/* $Id: guess.c,v 1.12 2003/01/17 07:59:35 kcwu Exp $ */ +/* $Id$ */ #include "bbs.h" #define LOGPASS BBSHOME "/etc/winguess.log" @@ -32,18 +32,18 @@ get_money(void) prints("您目前有:%d Ptt$", cuser.money); do { getdata(2, 0, "要賭多少(5-10或按q離開): ", data, 9, LCECHO); - money = strlen(data); + money = 0; if (data[0] == 'q' || data[0] == 'Q') { unlockutmpmode(); return 0; } - for (i = 0; i < money; i++) + for (i = 0; data[i]; i++) if (data[i] < '0' || data[i] > '9') { money = -1; break; } if (money != -1) { - money = atol(data); + money = atoi(data); reload_money(); if (money > cuser.money || money <= 4 || money > 10 || money < 1) |