You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2020/06/01 14:11:21 UTC

svn commit: r1878365 - /apr/apr/trunk/strings/apr_strings.c

Author: jorton
Date: Mon Jun  1 14:11:21 2020
New Revision: 1878365

URL: http://svn.apache.org/viewvc?rev=1878365&view=rev
Log:
Revert non-test part of r1878354, the Coverity warning was a
false -ve and there was no functional change nor bug.

Modified:
    apr/apr/trunk/strings/apr_strings.c

Modified: apr/apr/trunk/strings/apr_strings.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/strings/apr_strings.c?rev=1878365&r1=1878364&r2=1878365&view=diff
==============================================================================
--- apr/apr/trunk/strings/apr_strings.c (original)
+++ apr/apr/trunk/strings/apr_strings.c Mon Jun  1 14:11:21 2020
@@ -124,7 +124,7 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(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(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);