diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-30 14:45:47 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-30 14:45:47 +0800 |
commit | 6763214bc9544f13b45f27bf9355fbd82017b019 (patch) | |
tree | 5c8ec5dc7ce4d05e5f2800f3df7b3f47f3de49b9 /mbbsd/screen.c | |
parent | cd29a1da3cbeec80559309f8e16bba071137f2f8 (diff) | |
download | pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar.gz pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar.bz2 pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar.lz pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar.xz pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.tar.zst pttbbs-6763214bc9544f13b45f27bf9355fbd82017b019.zip |
- remove strncpy(). use memcpy() and strlcpy() instead.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3884 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r-- | mbbsd/screen.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 76a4f34f..8b518070 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -664,7 +664,7 @@ innstr(char *str, int n) slp->data[slp->len] = 0; strip_ansi(buf, (char*)slp->data, STRIP_ALL); buf[ANSILINELEN] = 0; - strncpy(str, buf, n); + strlcpy(str, buf, n); return strlen(str); } @@ -676,8 +676,7 @@ inansistr(char *str, int n) if (!slp) return 0; slp->data[slp->len] = 0; - strncpy(str, (char*)slp->data, n); - str[n] = 0; + strlcpy(str, (char*)slp->data, n); return strlen(str); } |