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/record.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/record.c')
-rw-r--r-- | mbbsd/record.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mbbsd/record.c b/mbbsd/record.c index 65c139cd..d50df1d9 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -578,9 +578,9 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * int n; for (n = strlen(fpath) - 1; fpath[n] != '/' && n > 0; n--); - strncpy(buf, fpath, n + 1); if (n + sizeof(".forward") > sizeof(buf)) return -1; + memcpy(buf, fpath, n+1); strcpy(buf + n + 1, ".forward"); if ((fp = fopen(buf, "r"))) { |