summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c7
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);
}