diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-23 03:02:01 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-23 03:02:01 +0800 |
commit | 8b45fd166b943e17dabb3f5cdf972baeb58e0346 (patch) | |
tree | 7b2e5bf09b7c9fd812d0ae7cacdfa049c4dc1e07 /mbbsd/dice.c | |
parent | a1bd04d7decea39d51bbc06b50755976d4184c50 (diff) | |
download | pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.gz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.bz2 pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.lz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.xz pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.tar.zst pttbbs-8b45fd166b943e17dabb3f5cdf972baeb58e0346.zip |
sprintf() -> snprintf()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@435 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/dice.c')
-rw-r--r-- | mbbsd/dice.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mbbsd/dice.c b/mbbsd/dice.c index 69d7486f..fae9d262 100644 --- a/mbbsd/dice.c +++ b/mbbsd/dice.c @@ -1,4 +1,4 @@ -/* $Id: dice.c,v 1.5 2002/07/21 09:26:02 in2 Exp $ */ +/* $Id: dice.c,v 1.6 2002/07/22 19:02:00 in2 Exp $ */ #include "bbs.h" #define DICE_TXT BBSHOME "/etc/dice.txt" @@ -454,9 +454,10 @@ dice_main(void) demoney(table[j].mymoney * ya + table[j].mymoney); total += table[j].mymoney * ya; if (table[j].mymoney * ya > 500) { /* 超過500塊錢才做log 減少io */ - sprintf(data, "%-15s 押%-2d選項%-8d塊錢 中了%d倍 淨賺:%-8d\n", - cuser.userid, table[j].mybet, - table[j].mymoney, ya, table[j].mymoney * ya); + snprintf(data, sizeof(data), + "%-15s 押%-2d選項%-8d塊錢 中了%d倍 淨賺:%-8d\n", + cuser.userid, table[j].mybet, + table[j].mymoney, ya, table[j].mymoney * ya); fputs(data, winfp); } ya = 0; |