diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-02 17:24:13 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-02 17:24:13 +0800 |
commit | 069c34022236bec41f00268386537d2da4a536e6 (patch) | |
tree | e73d2b2b8bf848c13c674e3b807c64970f25f9a2 | |
parent | 0487a9a1af3e435516f8a938d1a8b960a32e11b7 (diff) | |
download | pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar.gz pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar.bz2 pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar.lz pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar.xz pttbbs-069c34022236bec41f00268386537d2da4a536e6.tar.zst pttbbs-069c34022236bec41f00268386537d2da4a536e6.zip |
- BRC v3: MAX brc size may be overriden by config.h.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3611 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | mbbsd/brc.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h index 9cf75555..628f30f0 100644 --- a/include/config.h +++ b/include/config.h @@ -264,7 +264,7 @@ #define MAXTAGS 256 #define BRC_STRLEN 15 /* Length of board name */ -#define BRC_MAXSIZE 24576 +#define BRC_MAXSIZE 49152 #define BRC_MAXNUM 80 #define WRAPMARGIN (511) diff --git a/mbbsd/brc.c b/mbbsd/brc.c index 7d35018c..74346a5c 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -7,6 +7,7 @@ * original time_t as 'create'. */ +// WARNING: Check ../include/config.h, you may have overide these value there #ifndef BRC_MAXNUM #define BRC_STRLEN 15 /* Length of board name, for old brc */ #define BRC_MAXSIZE 49152 /* Effective size of brc rc file, 8192 * 3 * 2 */ @@ -253,7 +254,7 @@ brc_update(){ } } -static void +void read_brc2(void) { char brcfile[STRLEN]; @@ -304,6 +305,9 @@ read_brc2(void) // now cvthead is ready for v3. sz3 = cvt - cvthead; brc_get_buf(sz3); + // new size maybe smaller, check brc_alloc instead + if (sz3 > brc_alloc) + sz3 = brc_alloc; brc_size = sz3; memcpy(brc_buf, cvthead, sz3); |