summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2018-05-24 21:15:53 +0000
committerChristophe Jaillet <jailletc36@apache.org>2018-05-24 21:15:53 +0000
commit96192893c37c4204bc8720264495223da9875035 (patch)
tree8128f2d9393f6d8ebb60d15d3284bd77499ac220 /misc
parent553ad501e509f7e46fa30ed08d3edf39047bbca9 (diff)
downloadapr-96192893c37c4204bc8720264495223da9875035.tar.gz
Fix a potential usage of an un-init variable. (i.e. 'wch')
Up to now, this can NOT happen, because the only caller passes -1 for 'args'. So axe this useless parameter to avoid troubles. See PR 60086. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832203 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-rw-r--r--misc/win32/start.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/misc/win32/start.c b/misc/win32/start.c
index eb77d4a4d..131d55622 100644
--- a/misc/win32/start.c
+++ b/misc/win32/start.c
@@ -39,7 +39,7 @@ int APR_DECLARE_DATA apr_app_init_complete = 0;
* _CRT_BLOCK to trick the system into trusting our store.
*/
static int warrsztoastr(const char * const * *retarr,
- const wchar_t * arrsz, int args)
+ const wchar_t * arrsz)
{
const apr_wchar_t *wch;
apr_size_t totlen;
@@ -50,11 +50,9 @@ static int warrsztoastr(const char * const * *retarr,
char *strs;
int arg;
- if (args < 0) {
- for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
- if (!*wch)
- ++args;
- }
+ for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
+ if (!*wch)
+ ++args;
wsize = 1 + wch - arrsz;
/* This is a safe max allocation, we will alloc each
@@ -134,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
}
sysstr = GetEnvironmentStringsW();
- dupenv = warrsztoastr(&_environ, sysstr, -1);
+ dupenv = warrsztoastr(&_environ, sysstr);
if (env) {
*env = apr_malloc_dbg((dupenv + 1) * sizeof (char *),