summaryrefslogtreecommitdiffstats
path: root/mbbsd/board.c
diff options
context:
space:
mode:
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);
}