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/aids.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/aids.c')
-rw-r--r-- | mbbsd/aids.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/aids.c b/mbbsd/aids.c index 2b5baac7..56d19378 100644 --- a/mbbsd/aids.c +++ b/mbbsd/aids.c @@ -235,8 +235,8 @@ SearchAIDResult_t do_search_aid(void) aidu = aidc2aidu(sp); if((sp2 = strchr(sp, '@')) != NULL) { - strncpy(bname, sp2 + 1, IDLEN); - bname[IDLEN] = '\0'; + // assert(sizeof(bname) > IDLEN); + strlcpy(bname, sp2 + 1, IDLEN+1); *sp2 = '\0'; } else |