diff options
author | Stefan Fritsch <sf@apache.org> | 2010-07-31 22:08:44 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2010-07-31 22:08:44 +0200 |
commit | 02dc2d45cfe00db38ef519bebb6b74f87a03a464 (patch) | |
tree | 9871eb369e64bf87922282d11ccf65ef0b7b35c7 /server/util_pcre.c | |
parent | Replace apr_palloc+memcpy by apr_memdup (diff) | |
download | apache2-02dc2d45cfe00db38ef519bebb6b74f87a03a464.tar.xz apache2-02dc2d45cfe00db38ef519bebb6b74f87a03a464.zip |
Code cleanup: replace strncpy by apr_cpystrn or apr_pstrmemdup
Submitted by: Takashi Sato <takashi lans tv com>
PR: 43432
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@981086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_pcre.c')
-rw-r--r-- | server/util_pcre.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/server/util_pcre.c b/server/util_pcre.c index c69c978503..089c6d360b 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -85,10 +85,7 @@ if (errbuf_size > 0) apr_snprintf(errbuf, sizeof errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset); else - { - strncpy(errbuf, message, errbuf_size - 1); - errbuf[errbuf_size-1] = 0; - } + apr_cpystrn(errbuf, message, errbuf_size); } return length + addlength; |