summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/announce.c8
-rw-r--r--mbbsd/read.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 4b2382c1..3d293fb0 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -631,8 +631,12 @@ a_pastetagpost(menu_t * pm, int mode)
tagnum = TagNum;
// prevent if anything wrong
- if (tagnum >= MAXTAGS)
- tagnum = MAXTAGS;
+ if (tagnum >= MAXTAGS || tagnum < 0)
+ {
+ vmsg("內部錯誤。請把你剛剛進行的完整步驟貼到 "
+ GLOBAL_BUGREPORT " 板。");
+ return ans;
+ }
if (tagnum < 1)
return ans;
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 1335e812..d353b12a 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -57,7 +57,7 @@ Tagger(time4_t chrono, int recno, int mode)
}
if (!comp) {
- if (mode != TAG_TOGGLE)
+ if (mode != TAG_TOGGLE || TagNum <= 0)
return NA;
TagNum--;