summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-23 22:48:33 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-23 22:48:33 +0800
commitd7a43da3380ed5d8830948f974a1f60aed4ae062 (patch)
tree70e890099fc7e7f56c65ecfa08f5f6719a971eaf /mbbsd
parentfd18635c94ab081a973fc9193b562626fd7827f2 (diff)
downloadpttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar.gz
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar.bz2
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar.lz
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar.xz
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.tar.zst
pttbbs-d7a43da3380ed5d8830948f974a1f60aed4ae062.zip
- read: more check on TagNum to prevent announce paste bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3856 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/read.c6
-rw-r--r--mbbsd/var.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index d353b12a..1feb8fc4 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -1,7 +1,7 @@
/* $Id$ */
#include "bbs.h"
-static int headers_size;
+static int headers_size = 0;
static fileheader_t *headers = NULL;
static int last_line; // PTT: last_line 游標可指的最後一個
@@ -10,7 +10,7 @@ static int last_line; // PTT: last_line 游標可指的最後一個
/* ----------------------------------------------------- */
/* Tag List 標籤 */
/* ----------------------------------------------------- */
-static TagItem *TagList; /* ascending list */
+static TagItem *TagList = NULL; /* ascending list */
/**
* @param locus
@@ -19,7 +19,7 @@ static TagItem *TagList; /* ascending list */
void
UnTagger(int locus)
{
- if (locus > TagNum)
+ if (locus > TagNum || TagNum <= 0)
return;
TagNum--;
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 4023c019..12a4fabe 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -365,7 +365,7 @@ boardheader_t *bcache;
userinfo_t *currutmp;
/* read.c */
-int TagNum; /* tag's number */
+int TagNum = 0; /* tag's number */
int TagBoard = -1; /* TagBoard = 0 : user's mailbox */
/* TagBoard > 0 : bid where last taged */
char currdirect[64];