mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:06:52 +00:00
- Initialized the pointers for the init environment.
svn path=/trunk/; revision=12686
This commit is contained in:
parent
aaa5b3b1d4
commit
635e37f654
1 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: environ.c,v 1.12 2004/12/13 18:30:08 hbirr Exp $
|
||||
/* $Id$
|
||||
*
|
||||
* dllmain.c
|
||||
*
|
||||
|
@ -56,7 +56,7 @@ int BlockEnvToEnvironA(void)
|
|||
count++;
|
||||
}
|
||||
|
||||
_environ = malloc(count * sizeof(char*));
|
||||
__initenv = _environ = malloc(count * sizeof(char*));
|
||||
if (_environ)
|
||||
{
|
||||
for (ptr = environment_strings, envptr = _environ; count > 1; ptr += len)
|
||||
|
@ -71,6 +71,7 @@ int BlockEnvToEnvironA(void)
|
|||
free(*envptr);
|
||||
FreeEnvironmentStringsA(environment_strings);
|
||||
free(_environ);
|
||||
__initenv = _environ = NULL;
|
||||
return -1;
|
||||
}
|
||||
memcpy(*envptr++, ptr, len);
|
||||
|
@ -106,7 +107,7 @@ int BlockEnvToEnvironW(void)
|
|||
count++;
|
||||
}
|
||||
|
||||
_wenviron = malloc(count * sizeof(wchar_t*));
|
||||
__winitenv = _wenviron = malloc(count * sizeof(wchar_t*));
|
||||
if (_wenviron)
|
||||
{
|
||||
for (ptr = environment_strings, envptr = _wenviron; count > 1; ptr += len)
|
||||
|
@ -121,6 +122,7 @@ int BlockEnvToEnvironW(void)
|
|||
free(*envptr);
|
||||
FreeEnvironmentStringsW(environment_strings);
|
||||
free(_wenviron);
|
||||
__winitenv = _wenviron = NULL;
|
||||
return -1;
|
||||
}
|
||||
memcpy(*envptr++, ptr, len * sizeof(wchar_t));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue