summaryrefslogtreecommitdiffstats
path: root/mbbsd/board.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-30 14:54:40 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-07-30 14:54:40 +0800
commitc0c9d87226fcdd179335b6f7356499ce05219b09 (patch)
tree6fc81a1bab6ff112288402fcef31a9a3425a1e4c /mbbsd/board.c
parent9c890899dc1ffab3a2ba67402c3dcb7b3e0e4f02 (diff)
downloadpttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar.gz
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar.bz2
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar.lz
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar.xz
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.tar.zst
pttbbs-c0c9d87226fcdd179335b6f7356499ce05219b09.zip
use correct type: size_t/int/long/pointer
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2153 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r--mbbsd/board.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index fb69c8f1..a7c52332 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -200,9 +200,13 @@ load_boards(char *key)
}
if (class_bid <= 0) {
if( yank_flag == 0 ){ // fav mode
- fav_t *fav = get_current_fav();
-
- nbrd = (boardstat_t *)malloc(sizeof(boardstat_t) * get_data_number(fav));
+ fav_t *fav = get_current_fav();
+ int nfav = get_data_number(fav);
+ if( nfav == 0 ){
+ nbrd = (boardstat_t *)malloc(sizeof(boardstat_t) * 1);
+ goto EMPTYFAV;
+ }
+ nbrd = (boardstat_t *)malloc(sizeof(boardstat_t) * nfav);
for( i = 0 ; i < fav->DataTail; ++i ){
int state;
if (!(fav->favh[i].attr & FAVH_FAV))
@@ -247,6 +251,7 @@ load_boards(char *key)
state |= NBRD_TAG;
addnewbrdstat(fav_getid(&fav->favh[i]) - 1, NBRD_FAV | state);
}
+ EMPTYFAV:
if (brdnum == 0)
addnewbrdstat(0, 0);
}