diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-15 16:05:59 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-15 16:05:59 +0800 |
commit | a8b87ec695abd673d76c148985b0f255d7083ae5 (patch) | |
tree | d545f3d23782018e87b599f7c41a4d14adadcfc9 /mbbsd/brc.c | |
parent | dc0a8eb34da824f63ad76564999deddcb2c74342 (diff) | |
download | pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar.gz pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar.bz2 pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar.lz pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar.xz pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.tar.zst pttbbs-a8b87ec695abd673d76c148985b0f255d7083ae5.zip |
Work on linuxx.
git-svn-id: http://opensvn.csie.org/pttbbs/branches/scw.angel@1983 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/brc.c')
-rw-r--r-- | mbbsd/brc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c index ede94386..b41e27a7 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -9,7 +9,7 @@ #define BRC_BLOCKSIZE 1024 -#if MAX_BOARD > 32767 || BRC_MAXSIZE > 32767 +#if MAX_BOARD > 65535 || BRC_MAXSIZE > 65535 #error Max number of boards or BRC_MAXSIZE cannot fit in unsighed short, \ please rewrite brc.c #endif @@ -138,7 +138,7 @@ brc_enlarge_buf() return 0; memcpy(buffer, brc_buf, brc_alloc); free(brc_buf); - brc_alloc += BRC_BLOCKSIZE; + do brc_alloc += BRC_BLOCKSIZE; while(brc_size > brc_alloc); brc_buf = (char*)malloc(brc_alloc); memcpy(brc_buf, buffer, brc_alloc - BRC_BLOCKSIZE); return 1; @@ -172,8 +172,9 @@ brc_insert_record(brcbid_t bid, brcnbrd_t num, time_t* list) brc_size -= tnum; /* put on the beginning */ - if (num && (new_size = - sizeof(brcbid_t) + sizeof(brcnbrd_t) + num * sizeof(time_t))){ + if (num){ + new_size = sizeof(brcbid_t) + sizeof(brcnbrd_t) + + num * sizeof(time_t); brc_size += new_size; if (brc_size > brc_alloc && !brc_enlarge_buf()) brc_size = BRC_MAXSIZE; @@ -330,6 +331,8 @@ brc_initial_board(const char *boardname) brc_update(); /* write back first */ currbid = getbnum(boardname); + if( currbid == 0 ) + currbid = getbnum(DEFAULT_BOARD); currboard = bcache[currbid - 1].brdname; currbrdattr = bcache[currbid - 1].brdattr; |