diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-16 22:14:12 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-01-16 22:14:12 +0800 |
commit | 169cf5d08f377d095f133495e0577dcd8698cb25 (patch) | |
tree | 5c09b031be1672ae020f5d23d816fd2ee65d4771 /mbbsd/gamble.c | |
parent | 0ade0762a9549675b63ba71e671d851679c480d0 (diff) | |
download | pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar.gz pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar.bz2 pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar.lz pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar.xz pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.tar.zst pttbbs-169cf5d08f377d095f133495e0577dcd8698cb25.zip |
move global array into local.
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@611 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/gamble.c')
-rw-r--r-- | mbbsd/gamble.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index ed4cb724..d9b3ea2b 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -1,4 +1,4 @@ -/* $Id: gamble.c,v 1.30 2003/01/16 13:28:48 kcwu Exp $ */ +/* $Id: gamble.c,v 1.31 2003/01/16 14:14:12 kcwu Exp $ */ #include "bbs.h" #ifndef _BBS_UTIL_C_ @@ -6,7 +6,6 @@ #define MAX_ITEM_LEN 30 //最大 每一賭項名字長度 #define MAX_SUBJECT_LEN 650 //8*81 = 648 最大 主題長度 -static char betname[MAX_ITEM][MAX_ITEM_LEN]; static int currbid; static int @@ -25,7 +24,7 @@ load_ticket_record(char *direct, int ticket[]) } static int -show_ticket_data(char *direct, int *price, boardheader_t * bh) +show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, boardheader_t * bh) { int i, count, total = 0, end = 0, ticket[MAX_ITEM] = {0, 0, 0, 0, 0, 0, 0, 0}; FILE *fp; @@ -121,6 +120,7 @@ ticket(int bid) { int ch, n, price, count, end = 0; char path[128], fn_ticket[128]; + char betname[MAX_ITEM][MAX_ITEM_LEN]; boardheader_t *bh = NULL; if (bid) { @@ -133,7 +133,7 @@ ticket(int bid) lockreturn0(TICKET, LOCK_MULTI); while (1) { - count = show_ticket_data(path, &price, bh); + count = show_ticket_data(betname, path, &price, bh); if (count <= 0) { pressanykey(); break; @@ -177,9 +177,10 @@ openticket(int bid) int i, money = 0, count, bet, price, total = 0, ticket[8] = {0, 0, 0, 0, 0, 0, 0, 0}; boardheader_t *bh = getbcache(bid); FILE *fp, *fp1; + char betname[MAX_ITEM][MAX_ITEM_LEN]; setbpath(path, bh->brdname); - count = -show_ticket_data(path, &price, bh); + count = -show_ticket_data(betname, path, &price, bh); if (count == 0) { setbfile(buf, bh->brdname, FN_TICKET_END); unlink(buf); |