fix efreet/file monitor stringshare optimization
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 23 Apr 2016 14:45:28 +0000 (23:45 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 23 Apr 2016 14:45:28 +0000 (23:45 +0900)
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. :)

src/lib/ecore_file/ecore_file_monitor_inotify.c
src/lib/ecore_file/ecore_file_monitor_poll.c
src/lib/ecore_file/ecore_file_monitor_win32.c

index 374d709..fa21421 100644 (file)
@@ -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);
 
index 16f8419..d2034dc 100644 (file)
@@ -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);
 
index 20f2ad0..8a0f92d 100644 (file)
@@ -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);