summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 17:24:13 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 17:24:13 +0800
commit069c34022236bec41f00268386537d2da4a536e6 (patch)
treee73d2b2b8bf848c13c674e3b807c64970f25f9a2 /mbbsd
parent0487a9a1af3e435516f8a938d1a8b960a32e11b7 (diff)
downloadpttbbs-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
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/brc.c6
1 files changed, 5 insertions, 1 deletions
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);