diff options
author | Jim Jagielski <jim@apache.org> | 2013-10-17 15:14:27 +0000 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2013-10-17 15:14:27 +0000 |
commit | 55703f0e3191ad971f28c173b3152ceb982c0297 (patch) | |
tree | 563edaf1357383a9e84d5ebb64cbd074d8357520 /strings | |
parent | 83f1d0dd4db126de59e7c23dcfaacfe247743b4a (diff) | |
download | apr-55703f0e3191ad971f28c173b3152ceb982c0297.tar.gz |
revret 1533105
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1533107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r-- | strings/apr_cpystrn.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/strings/apr_cpystrn.c b/strings/apr_cpystrn.c index d6c98f7e9..6311c29f3 100644 --- a/strings/apr_cpystrn.c +++ b/strings/apr_cpystrn.c @@ -38,7 +38,6 @@ * (3) Instead of returning the pointer to the beginning of * the destination string, we return a pointer to the * terminating '\0' to allow us to "check" for truncation - * (4) If src is NULL, null terminate dst (empty string copy) * * apr_cpystrn() follows the same call structure as strncpy(). */ @@ -52,15 +51,13 @@ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size) return (dst); } - if (src) { - d = dst; - end = dst + dst_size - 1; + d = dst; + end = dst + dst_size - 1; - for (; d < end; ++d, ++src) { - if (!(*d = *src)) { - return (d); - } - } + for (; d < end; ++d, ++src) { + if (!(*d = *src)) { + return (d); + } } *d = '\0'; /* always null terminate */ |