summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/fav.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mbbsd/fav.c b/mbbsd/fav.c
index 9a658efd..4c47ca64 100644
--- a/mbbsd/fav.c
+++ b/mbbsd/fav.c
@@ -1087,8 +1087,9 @@ void updatenewfav(int mode)
brd[i] = BRD_NEW;
}
}
- if( i < brdnum) // the board number may change
- for(i-- ; i < brdnum; i++){
+
+ if( i < brdnum) { // the board number may change
+ for(; i < brdnum; ++i){
if(bcache[i].brdname[0] && HasPerm(&bcache[i])){
if(mode && !(bcache[i].brdattr & BRD_SYMBOLIC))
fav_add_board(i + 1);
@@ -1097,11 +1098,13 @@ void updatenewfav(int mode)
else
brd[i] = BRD_NEW;
}
+ }
brd[i] = BRD_END;
-
+
lseek(fd, 0, SEEK_SET);
- write(fd, brd, (brdnum + 1 ) * sizeof(char));
+ write(fd, brd, (brdnum + 1) * sizeof(char));
+
free(brd);
close(fd);
}