saftery for strncpy
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 24 Jan 2010 02:23:43 +0000 (02:23 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 24 Jan 2010 02:23:43 +0000 (02:23 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@45505 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_file/ecore_file.c

index 2dcff23..8e37e42 100644 (file)
@@ -602,6 +602,7 @@ ecore_file_dir_get(const char *file)
 
    if (!file) return NULL;
    strncpy(buf, file, PATH_MAX);
+   buf[PATH_MAX - 1] = 0;
    p = dirname(buf);
    return strdup(p);
 }