diff options
author | delphij <delphij@FreeBSD.org> | 2008-10-17 21:29:05 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2008-10-17 21:29:05 +0000 |
commit | cae7e20d60f91e9cb0d69d46fd202a00f4963bde (patch) | |
tree | 194e3924de9e172822bdccb51bda9541e237a6da /lib/libc/string/strxfrm.c | |
parent | 767e2acdc70d46a3950466a91899ee6e591ec838 (diff) | |
download | FreeBSD-src-cae7e20d60f91e9cb0d69d46fd202a00f4963bde.zip FreeBSD-src-cae7e20d60f91e9cb0d69d46fd202a00f4963bde.tar.gz |
Use strlcpy() in !localized case to avoid the -1's.
Diffstat (limited to 'lib/libc/string/strxfrm.c')
-rw-r--r-- | lib/libc/string/strxfrm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c index 81e05af..cce6c0f 100644 --- a/lib/libc/string/strxfrm.c +++ b/lib/libc/string/strxfrm.c @@ -51,8 +51,7 @@ strxfrm(char * __restrict dest, const char * __restrict src, size_t len) if (slen < len) strcpy(dest, src); else { - strncpy(dest, src, len - 1); - dest[len - 1] = '\0'; + strlcpy(dest, src, len); } } return slen; |