summaryrefslogtreecommitdiff
path: root/misc/win32/start.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-04-13 19:27:24 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-04-13 19:27:24 +0000
commit73c582bf2f871b1a7b99d3ba6eca9895e34e3517 (patch)
tree7d9f390bd49daaabbe7eb2594745d3e71908558c /misc/win32/start.c
parente16178bd76bc9a49b1426246360aa8bd865b3b8a (diff)
downloadlibapr-73c582bf2f871b1a7b99d3ba6eca9895e34e3517.tar.gz
Correct const'ification of apr_app_initialize and internal related
functions, as pointed out by GStein. Also fix a -very- significant bug in win32/apr_app_initialize() where we misassigned the new env memory to env rather than *env as required. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63260 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc/win32/start.c')
-rw-r--r--misc/win32/start.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/misc/win32/start.c b/misc/win32/start.c
index 36fc7ac6c..340c62960 100644
--- a/misc/win32/start.c
+++ b/misc/win32/start.c
@@ -75,9 +75,10 @@ int APR_DECLARE_DATA apr_app_init_complete = 0;
* as a list of strings. These are allocated from the MSVCRT's
* _CRT_BLOCK to trick the system into trusting our store.
*/
-static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args)
+static int warrsztoastr(const char * const * *retarr,
+ const wchar_t * arrsz, int args)
{
- apr_wchar_t *wch;
+ const apr_wchar_t *wch;
size_t totlen;
size_t newlen;
size_t wsize;
@@ -128,7 +129,9 @@ static int warrsztoastr(char ***retarr, wchar_t *arrsz, int args)
/* Reprocess the arguments to main() for a completely apr-ized application
*/
-APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***env)
+APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
+ const char * const * *argv,
+ const char * const * *env)
{
#if APR_HAS_UNICODE_FS
IF_WIN_OS_IS_UNICODE
@@ -155,9 +158,9 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char ***argv, char ***en
dupenv = warrsztoastr(&_environ, sysstr, -1);
if (env) {
- env = _malloc_dbg((dupenv + 1) * sizeof (char *),
- _CRT_BLOCK, __FILE__, __LINE__ );
- memcpy(*env, _environ, (dupenv + 1) * sizeof (char *));
+ *env = _malloc_dbg((dupenv + 1) * sizeof (char *),
+ _CRT_BLOCK, __FILE__, __LINE__ );
+ memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *));
}
else {
}