From e0cf6694429fc9e8e5c2be68569d441da8df49c7 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 23 Jan 2008 15:36:32 +0000 Subject: - Tagging: offset-by-one error on alerting user git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3857 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/announce.c | 2 +- mbbsd/read.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 7a10ef8c..831444f6 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -645,7 +645,7 @@ a_pastetagpost(menu_t * pm, int mode) tagnum = TagNum; // prevent if anything wrong - if (tagnum >= MAXTAGS || tagnum < 0) + if (tagnum > MAXTAGS || tagnum < 0) { vmsg("內部錯誤。請把你剛剛進行的完整步驟貼到 " GLOBAL_BUGREPORT " 板。"); diff --git a/mbbsd/read.c b/mbbsd/read.c index 1feb8fc4..db503a0f 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -35,7 +35,7 @@ Tagger(time4_t chrono, int recno, int mode) int head, tail, posi = 0, comp; if(TagList == NULL) { - TagList = malloc(sizeof(TagItem)*MAXTAGS); + TagList = malloc(sizeof(TagItem)*(MAXTAGS+1)); } for (head = 0, tail = TagNum - 1, comp = 1; head <= tail;) { -- cgit v1.2.3