summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c5
-rw-r--r--mbbsd/read.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 1c7fd538..b98070d5 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -195,8 +195,9 @@ readdoent(int num, fileheader_t * ent)
else
color = '3', mark = "R:";
- if (title[45]) /* 把多餘的 string 砍掉 */
- strlcpy(title + 42, " …", sizeof(title) - 42);
+ /* 把多餘的 string 砍掉 */
+ if (title[45])
+ strlcpy(title + PROPER_TITLE_LEN, " …", sizeof(title) - PROPER_TITLE_LEN);
if (!strncmp(title, "[公告]", 6))
special = 1;
diff --git a/mbbsd/read.c b/mbbsd/read.c
index cb48b594..0a1e7197 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -278,12 +278,12 @@ thread(keeploc_t * locmem, int stypen)
get_record_keep(currdirect, &fh, sizeof(fileheader_t), new_ln, &fd);
if( stypen & RS_TITLE ){
if( stypen & RS_FIRST ){
- if( !strcmp(fh.title, key) )
+ if( !strncmp(fh.title, key, PROPER_TITLE_LEN) )
break;
- else if( !strcmp(&fh.title[4], key) )
+ else if( !strncmp(&fh.title[4], key, PROPER_TITLE_LEN) )
amatch = new_ln;
}
- else if( !strcmp(subject(fh.title), key) )
+ else if( !strncmp(subject(fh.title), key, PROPER_TITLE_LEN) )
break;
}
else if( stypen & RS_NEWPOST ){