diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-04-23 23:45:28 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-04-23 23:45:28 +0900 |
commit | bbcde33f93ab786f0cafdfbfbdead20cd1009d7d (patch) | |
tree | 268c75c56492d9e34a3b1be8f0d994cb1c5f152f | |
parent | df2b31b63eaed894601ba8126d1f43f07edb6332 (diff) | |
download | efl-bbcde33f93ab786f0cafdfbfbdead20cd1009d7d.tar.gz |
fix efreet/file monitor stringshare optimization
fixes e4d815dc48c660a336670ec3cc67e6becbdcacfc that i just put in a
few days back - it's a good idea to copy the string into your buffer
to use it.. not just 0 terminate it. :)
-rw-r--r-- | src/lib/ecore_file/ecore_file_monitor_inotify.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_file/ecore_file_monitor_poll.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_file/ecore_file_monitor_win32.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c index 374d709265..fa214213e8 100644 --- a/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -126,6 +126,7 @@ ecore_file_monitor_backend_add(const char *path, len = strlen(path); path2 = alloca(len + 1); + strcpy(path2, path); if (path2[len - 1] == '/' && strcmp(path2, "/")) path2[len - 1] = 0; em->path = eina_stringshare_add(path2); diff --git a/src/lib/ecore_file/ecore_file_monitor_poll.c b/src/lib/ecore_file/ecore_file_monitor_poll.c index 16f84194ce..d2034dc7ab 100644 --- a/src/lib/ecore_file/ecore_file_monitor_poll.c +++ b/src/lib/ecore_file/ecore_file_monitor_poll.c @@ -87,6 +87,7 @@ ecore_file_monitor_backend_add(const char *path, len = strlen(path); path2 = alloca(len + 1); + strcpy(path2, path); if (path2[len - 1] == '/' && strcmp(path2, "/")) path2[len - 1] = 0; em->path = eina_stringshare_add(path2); diff --git a/src/lib/ecore_file/ecore_file_monitor_win32.c b/src/lib/ecore_file/ecore_file_monitor_win32.c index 20f2ad02ad..8a0f92dca7 100644 --- a/src/lib/ecore_file/ecore_file_monitor_win32.c +++ b/src/lib/ecore_file/ecore_file_monitor_win32.c @@ -259,6 +259,7 @@ ecore_file_monitor_backend_add(const char *path, len = strlen(path); path2 = alloca(len + 1); + strcpy(path2, path); if (path2[len - 1] == '/' || path2[len - 1] == '\\') path2[len - 1] = 0; em->path = eina_stringshare_add(path2); |