From 069c34022236bec41f00268386537d2da4a536e6 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 2 Dec 2007 09:24:13 +0000 Subject: - 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 --- mbbsd/brc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mbbsd') 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); -- cgit v1.2.3