diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-10-21 11:55:04 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-10-21 11:55:04 +0800 |
commit | 538d328a4d98bd1852225ca144cb4893f3df98f0 (patch) | |
tree | f691ca65f01d3d3bfe127e0cdd8330fc3673c765 /mbbsd | |
parent | 9cfd1c185ce0d0e76780f6432c4324d965e2abf7 (diff) | |
download | pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar.gz pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar.bz2 pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar.lz pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar.xz pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.tar.zst pttbbs-538d328a4d98bd1852225ca144cb4893f3df98f0.zip |
Check if boards are full when creating new boards
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4408 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 3103e831..140261b9 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -890,6 +890,8 @@ static int add_board_record(const boardheader_t *board) substitute_record(fn_board, board, sizeof(boardheader_t), bid); reset_board(bid); sort_bcache(); + } else if (SHM->Bnumber >= MAX_BOARD) { + return -1; } else if (append_record(fn_board, (fileheader_t *)board, sizeof(boardheader_t)) == -1) { return -1; } else { @@ -1006,7 +1008,14 @@ m_newbrd(int whatclass, int recover) } } - add_board_record(&newboard); + if (add_board_record(&newboard) < 0) { + if (SHM->Bnumber >= MAX_BOARD) + vmsg("看板已滿,請洽系統站長"); + else + vmsg("看板寫入失敗"); + return -1; + } + getbcache(whatclass)->childcount = 0; pressanykey(); setup_man(&newboard, NULL); |