summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2020-06-01 14:11:21 +0000
committerJoe Orton <jorton@apache.org>2020-06-01 14:11:21 +0000
commit5243aad9003ae9c2bbead0d1858ac591621c7808 (patch)
treea1656fbece1cc1bc8dc462350e652bd6ed9e5a41 /strings
parent4b53081b2fc3f5ff719b9ae0c49cee1c12f0e9cb (diff)
downloadapr-5243aad9003ae9c2bbead0d1858ac591621c7808.tar.gz
Revert non-test part of r1878354, the Coverity warning was a
false -ve and there was no functional change nor bug. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1878365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strings')
-rw-r--r--strings/apr_strings.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/strings/apr_strings.c b/strings/apr_strings.c
index ed999561b..beca6d480 100644
--- a/strings/apr_strings.c
+++ b/strings/apr_strings.c
@@ -124,7 +124,7 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
{
char *cp, *argp, *res;
apr_size_t saved_lengths[MAX_SAVED_LENGTHS];
- unsigned n, nargs = 0;
+ int nargs = 0;
/* Pass one --- find length of required string */
@@ -152,10 +152,10 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
va_start(adummy, a);
- n = 0;
+ nargs = 0;
while ((argp = va_arg(adummy, char *)) != NULL) {
- if (n < nargs) {
- len = saved_lengths[n++];
+ if (nargs < MAX_SAVED_LENGTHS) {
+ len = saved_lengths[nargs++];
}
else {
len = strlen(argp);