forked from enlightenment/efl
eina: use less stack on Windows for eina_environment_home_get, and no snprintf()
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
bd1d996545
commit
a988a8fc99
|
@ -41,7 +41,7 @@
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static char home_storage[PATH_MAX];
|
static char home_storage[8];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
@ -55,8 +55,9 @@ eina_environment_home_get(void)
|
||||||
if (!home &&
|
if (!home &&
|
||||||
(getenv("HOMEDRIVE") && getenv("HOMEPATH")))
|
(getenv("HOMEDRIVE") && getenv("HOMEPATH")))
|
||||||
{
|
{
|
||||||
snprintf(home_storage, sizeof(home_storage), "%s%s",
|
memcpy(home_storage, getenv("HOMEDRIVE"), strlen(getenv("HOMEDRIVE")));
|
||||||
getenv("HOMEDRIVE"), getenv("HOMEPATH"));
|
memcpy(home_storage + strlen(getenv("HOMEDRIVE")),
|
||||||
|
getenv("HOMEPATH"), strlen(getenv("HOMEPATH")) + 1);
|
||||||
home = home_storage;
|
home = home_storage;
|
||||||
}
|
}
|
||||||
if (!home) home = "C:\\";
|
if (!home) home = "C:\\";
|
||||||
|
|
Loading…
Reference in New Issue