summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-18 22:07:08 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-18 22:07:08 +0800
commitd9268ea3021f7112244a894a33882edcc408bf1a (patch)
tree291838fcf20d715ec99c05716124a071c456108a /mbbsd/bbs.c
parentfee7749052ac9aab275c17be9e6bf923394b63f0 (diff)
downloadpttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar.gz
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar.bz2
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar.lz
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar.xz
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.tar.zst
pttbbs-d9268ea3021f7112244a894a33882edcc408bf1a.zip
1. make tty_read more clear and reable
2. hack to prevent ^W SIGSEGV when parent is incorrect. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2697 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 5ed39f8f..4aa5d213 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -251,7 +251,7 @@ readdoent(int num, fileheader_t * ent)
int
whereami(int ent, const fileheader_t * fhdr, const char *direct)
{
- boardheader_t *bh, *p[WHEREAMI_LEVEL], *root;
+ boardheader_t *bh, *p[WHEREAMI_LEVEL];
int i, j;
if (!currutmp->brc_id)
@@ -260,9 +260,8 @@ whereami(int ent, const fileheader_t * fhdr, const char *direct)
move(1, 0);
clrtobot();
bh = getbcache(currutmp->brc_id);
- root = getbcache(1);
p[0] = bh;
- for (i = 0; i+1 < WHEREAMI_LEVEL && p[i]->parent>1; i++)
+ for (i = 0; i+1 < WHEREAMI_LEVEL && p[i]->parent>1 && p[i]->parent < numboards; i++)
p[i + 1] = getbcache(p[i]->parent);
j = i;
prints("§Ú¦b­þ?\n%-40.40s %.13s\n", p[j]->title + 7, p[j]->BM);