diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-27 15:11:43 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-27 15:11:43 +0800 |
commit | fc5a307fe3e037fc6b33475e1ab744054b030493 (patch) | |
tree | 912a3efd5312e1bec3b9b04b9eca4905b4ff257d /mbbsd | |
parent | 6a049ab7d7709f5ff8c326915c79faa1106324c8 (diff) | |
download | pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar.gz pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar.bz2 pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar.lz pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar.xz pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.tar.zst pttbbs-fc5a307fe3e037fc6b33475e1ab744054b030493.zip |
skip non-existing board for do_crosspost
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3496 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 54fdf095..0b11fe81 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -677,10 +677,13 @@ do_crosspost(const char *brd, fileheader_t *postfile, const char *fpath, char genbuf[200]; int len = 42-strlen(currboard); fileheader_t fh; + int bid = getbnum(brd); + + if(bid <= 0 || bid > MAX_BOARD) return; + if(!strncasecmp(postfile->title, str_reply, 3)) len=len+4; - memcpy(&fh, postfile, sizeof(fileheader_t)); if(isstamp) { @@ -699,8 +702,6 @@ do_crosspost(const char *brd, fileheader_t *postfile, const char *fpath, postfile->filemode = FILE_LOCAL; setbdir(genbuf, brd); if (append_record(genbuf, &fh, sizeof(fileheader_t)) != -1) { - int bid = getbnum(brd); - assert(0<=bid-1 && bid-1<MAX_BOARD); SHM->lastposttime[bid - 1] = now; touchbpostnum(bid, 1); } |