diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 16:18:42 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 16:18:42 +0800 |
commit | 1428a82d1644166fdaa5285c67f236ac02687818 (patch) | |
tree | 276d0104ebeaef1c5ce7ab7cf8484a685669a15d /mbbsd/indict.c | |
parent | 913a0db139ff6f56e26d1199e7f5ad1c6239c5ea (diff) | |
download | pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.gz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.bz2 pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.lz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.xz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.zst pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.zip |
strcpy() -> strlcpy()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@428 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/indict.c')
-rw-r--r-- | mbbsd/indict.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/indict.c b/mbbsd/indict.c index 5a575211..6e44c612 100644 --- a/mbbsd/indict.c +++ b/mbbsd/indict.c @@ -1,4 +1,4 @@ -/* $Id: indict.c,v 1.5 2002/07/05 17:10:27 in2 Exp $ */ +/* $Id: indict.c,v 1.6 2002/07/21 08:18:41 in2 Exp $ */ #include "bbs.h" #define REFER "etc/dicts" @@ -58,8 +58,8 @@ choose_dict(void) cho[0] = (cho[0] + 1) * 10 + (cho[1] - '1'); if (cho[0] >= 0 && cho[0] < c) { - strcpy(dict, buf[(int)cho[0]]); - strcpy(database, data[(int)cho[0]]); + strlcpy(dict, buf[(int)cho[0]], sizeof(dict)); + strlcpy(database, data[(int)cho[0]], sizeof(database)); return 1; } else return 0; @@ -96,7 +96,7 @@ use_dict() sprintf(buf, "\033[45m ●\033[1;44;33m" " %-14s\033[3;45m ● ", dict); - strcpy(&buf[100], "\033[m\n"); + strlcpy(&buf[100], "\033[m\n", sizeof(buf) - 100); for (;;) { move(0, 0); sprintf(lang, " 請輸入關鍵字串(%s) 或指令(h,t,a)\n", dict); @@ -106,7 +106,7 @@ use_dict() outs(lang); getdata(2, 0, ":", word, 18, DOECHO); outs("資料搜尋中請稍候...."); - strcpy(word, lower(word)); + strlcpy(word, lower(word), sizeof(word)); if (word[0] == 0) return 0; clear(); |