Fix static analysis issue 13/115113/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 16 Feb 2017 08:12:37 +0000 (17:12 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 16 Feb 2017 09:49:58 +0000 (18:49 +0900)
Change-Id: I7a5e52bdaaf5e1379c06aaca6f5363f709d04cbe
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/delta.c

index ddc8455..1218642 100644 (file)
@@ -51,7 +51,6 @@ static GList *__list_directory(const char *dir_name, const char *tpk_path, GList
 {
        DIR *dir = NULL;
        struct dirent *file_info = NULL;
-       int flag = 0;
        char path[PATH_MAX] = {0, };
        char rel_path_old_tpk_file[PATH_MAX] = {0, };
        char *file_path = NULL;
@@ -91,14 +90,6 @@ static GList *__list_directory(const char *dir_name, const char *tpk_path, GList
                }
        }
 
-       if (flag == 1) {
-               snprintf(rel_path_old_tpk_file, PATH_MAX, "%s/", dir_name);
-               strncpy(path, rel_path_old_tpk_file+strlen(tpk_path),
-                               strlen(rel_path_old_tpk_file));
-               file_path = strndup(path, sizeof(path));
-               list = g_list_prepend(list, file_path);
-       }
-
        if (closedir(dir)) {
                if (strerror_r(errno, buf, sizeof(buf)) == 0)
                        printf("Could not close '%s': %s\n", dir_name, buf);