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)
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 @@
41 *============================================================================*/ 41 *============================================================================*/
42 42
43#ifdef _WIN32 43#ifdef _WIN32
44static char home_storage[PATH_MAX]; 44static char home_storage[8];
45#endif 45#endif
46 46
47EAPI const char * 47EAPI const char *
@@ -55,8 +55,9 @@ eina_environment_home_get(void)
55 if (!home && 55 if (!home &&
56 (getenv("HOMEDRIVE") && getenv("HOMEPATH"))) 56 (getenv("HOMEDRIVE") && getenv("HOMEPATH")))
57 { 57 {
58 snprintf(home_storage, sizeof(home_storage), "%s%s", 58 memcpy(home_storage, getenv("HOMEDRIVE"), strlen(getenv("HOMEDRIVE")));
59 getenv("HOMEDRIVE"), getenv("HOMEPATH")); 59 memcpy(home_storage + strlen(getenv("HOMEDRIVE")),
60 getenv("HOMEPATH"), strlen(getenv("HOMEPATH")) + 1);
60 home = home_storage; 61 home = home_storage;
61 } 62 }
62 if (!home) home = "C:\\"; 63 if (!home) home = "C:\\";