summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2015-05-15 09:03:48 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-18 10:36:58 +0200
commita988a8fc99be97eb5866ca324bc91f0f20deec09 (patch)
tree2b8b237164ccb2b9fad0d00a41e18438e860a244 /src/lib/eina
parentbd1d996545226f0ab4fde680c36a22104f7632d4 (diff)
downloadefl-a988a8fc99be97eb5866ca324bc91f0f20deec09.tar.gz
eina: use less stack on Windows for eina_environment_home_get, and no snprintf()
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/eina/eina_util.c b/src/lib/eina/eina_util.c
index 392eee39f2..4f0408464c 100644
--- a/src/lib/eina/eina_util.c
+++ b/src/lib/eina/eina_util.c
@@ -41,7 +41,7 @@
*============================================================================*/
#ifdef _WIN32
-static char home_storage[PATH_MAX];
+static char home_storage[8];
#endif
EAPI const char *
@@ -55,8 +55,9 @@ eina_environment_home_get(void)
if (!home &&
(getenv("HOMEDRIVE") && getenv("HOMEPATH")))
{
- snprintf(home_storage, sizeof(home_storage), "%s%s",
- getenv("HOMEDRIVE"), getenv("HOMEPATH"));
+ memcpy(home_storage, getenv("HOMEDRIVE"), strlen(getenv("HOMEDRIVE")));
+ memcpy(home_storage + strlen(getenv("HOMEDRIVE")),
+ getenv("HOMEPATH"), strlen(getenv("HOMEPATH")) + 1);
home = home_storage;
}
if (!home) home = "C:\\";