summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-23 02:01:23 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-23 02:01:23 +0800
commit3b41c215b669ac33a15f4f9e697e1d59fe180a99 (patch)
tree98e78fae68e0cfefd1b77e06432e2f7edf1bd66a /mbbsd
parent6597ef386219ea285deb3352371267f202784b68 (diff)
downloadpttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar.gz
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar.bz2
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar.lz
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar.xz
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.tar.zst
pttbbs-3b41c215b669ac33a15f4f9e697e1d59fe180a99.zip
change record stampfile function
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@336 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/gamble.c4
-rw-r--r--mbbsd/record.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c
index 917d71b6..d37b5fa5 100644
--- a/mbbsd/gamble.c
+++ b/mbbsd/gamble.c
@@ -1,4 +1,4 @@
-/* $Id: gamble.c,v 1.17 2002/06/22 07:23:22 ptt Exp $ */
+/* $Id: gamble.c,v 1.18 2002/06/22 18:01:23 ptt Exp $ */
#include "bbs.h"
#ifndef _BBS_UTIL_C_
@@ -333,7 +333,7 @@ int openticket(int bid) {
while (fscanf(fp1, "%s %d %d\n", userid, &mybet, &i) != EOF)
{
- if (bet==98 )
+ if (bet==98 && mybet>=0 && mybet<count )
{
fprintf(fp,"%s ¶R¤F %d ±i %s, °h¦^ %d ªT¢Þ¹ô\n"
,userid, i, betname[mybet], money);
diff --git a/mbbsd/record.c b/mbbsd/record.c
index a29988b7..36b48847 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -1,4 +1,4 @@
-/* $Id: record.c,v 1.5 2002/06/04 13:08:34 in2 Exp $ */
+/* $Id: record.c,v 1.6 2002/06/22 18:01:23 ptt Exp $ */
#include "bbs.h"
#undef HAVE_MMAP
@@ -417,7 +417,7 @@ int stampfile(char *fpath, fileheader_t *fh) {
while (*(++ip));
*ip++ = '/';
do {
- sprintf(ip, "M.%ld.A", ++dtime );
+ sprintf(ip, "M.%ld.A.%3.3X", ++dtime, rand()&0xFFF );
if(fp == -1 && errno != EEXIST)
return -1;
} while((fp = open(fpath, O_CREAT | O_EXCL | O_WRONLY, 0644)) == -1);