summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 16:22:10 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 16:22:10 +0800
commit0487a9a1af3e435516f8a938d1a8b960a32e11b7 (patch)
tree334f10927e9ba29c91b61c0711e597542c99762f /mbbsd
parent265caeebaf11f1ba546b8114c62356490c3b5444 (diff)
downloadpttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar.gz
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar.bz2
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar.lz
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar.xz
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.tar.zst
pttbbs-0487a9a1af3e435516f8a938d1a8b960a32e11b7.zip
- brc v3 update: ptt2's MAX_BOAORD reached uint16 limitation,
so expand board size at same time for brc v3. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3610 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/brc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c
index 0d93169b..7d35018c 100644
--- a/mbbsd/brc.c
+++ b/mbbsd/brc.c
@@ -20,8 +20,8 @@
please rewrite brc.c
#endif
-typedef unsigned short brcbid_t;
-typedef unsigned short brcnbrd_t;
+typedef uint32_t brcbid_t;
+typedef uint16_t brcnbrd_t;
typedef struct {
time4_t create;
@@ -261,6 +261,9 @@ read_brc2(void)
size_t sz2 = 0, sz3 = 0;
char *cvt = NULL, *cvthead = NULL;
+ // brc v2 is using 16 bit for brcbid_t and brcnbrd_t.
+ uint16_t bid2, num2;
+
brcbid_t bid;
brcnbrd_t num;
time4_t create;
@@ -277,13 +280,16 @@ read_brc2(void)
cvthead = cvt = malloc (sz3);
// now calculate real sz3
- while (read(fd, &bid, sizeof(bid)) > 0)
+ while (read(fd, &bid2, sizeof(bid2)) > 0)
{
- if (read(fd, &num, sizeof(num)) < 1)
+ if (read(fd, &num2, sizeof(num2)) < 1)
break;
- *(brcbid_t*)cvt = bid; cvt += sizeof(brcbid_t);
- *(brcnbrd_t*)cvt = num;cvt += sizeof(brcnbrd_t);
+ bid = bid2;
+ num = num2;
+
+ *(brcbid_t*) cvt = bid; cvt += sizeof(brcbid_t);
+ *(brcnbrd_t*)cvt = num; cvt += sizeof(brcnbrd_t);
for (; num > 0; num--)
{