From fc5a307fe3e037fc6b33475e1ab744054b030493 Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 27 Mar 2007 07:11:43 +0000 Subject: skip non-existing board for do_crosspost git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3496 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mbbsd/bbs.c') 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-1lastposttime[bid - 1] = now; touchbpostnum(bid, 1); } -- cgit v1.2.3