{
icon_info_s *icon_info = NULL;
DIR *dir_info = NULL;
+ struct dirent ent_struct;
struct dirent *dir_entry = NULL;
int ret = 0;
dir_info = opendir(dir_path);
goto_if(!dir_info, error);
- while ((dir_entry = readdir(dir_info))) {
+ while (!readdir_r(dir_info, &ent_struct, &dir_entry) && dir_entry) {
icon_image_s *icon_image = NULL;
char *d_name = NULL;
char *filename = NULL;
char *ext = NULL;
char *tmp = NULL;
+ char *save_ptr = NULL;
char full_path[PATH_LEN] = {0, };
char thumbnail_file[PATH_LEN] = {0, };
struct stat stat_buf = {0, };
icon_image->file = strdup(full_path);
goto_if(!icon_image->file, not_sticker);
- filename = strtok(d_name, ".");
+ filename = strtok_r(d_name, ".", &save_ptr);
goto_if(!filename, not_sticker);
- ext = strtok(NULL, ".");
+ ext = strtok_r(NULL, ".", &save_ptr);
goto_if(!ext, not_sticker);
- tmp = strtok(filename, "_");
+ tmp = strtok_r(filename, "_", &save_ptr);
goto_if(!tmp, not_sticker);
if (!icon_info->keyword) {
goto_if(!icon_info->keyword, not_sticker);
}
- if ((tmp = strtok(NULL, "_"))) {
+ if ((tmp = strtok_r(NULL, "_", &save_ptr))) {
if (!strcmp(tmp, STICKER_IMG_NAME_TOKEN_SUB)) {
goto not_sticker;
} else if (!strcmp(tmp, STICKER_IMG_NAME_TOKEN_TH)) {
}
} else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_image->diff_time = atoi(tmp);
else
goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->repeat = atoi(tmp);
else
goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->interval = atoi(tmp);
else
goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->play_type = atoi(tmp);
else
goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->th_frame = atoi(tmp);
next:
char file_path[PATH_LEN] = {0, };
char *tab_thumbnail = NULL;
DIR *dir_info = NULL;
+ struct dirent ent_struct;
struct dirent *dir_entry = NULL;
struct stat stat_buf = {0, };
int ret = 0;
dir_info = opendir(dir_path);
retv_if(!dir_info, NULL);
- while ((dir_entry = readdir(dir_info))) {
+ while (!readdir_r(dir_info, &ent_struct, &dir_entry) && dir_entry) {
if (!strcmp(".", dir_entry->d_name) || !strcmp("..", dir_entry->d_name))
continue;
static Eina_List *__append_preset_group_icon_info_list(Eina_List *group_icon_info_list, const char *preset_dir_path, sqlite3 *db)
{
DIR *dir_info = NULL;
+ struct dirent ent_struct;
struct dirent *dir_entry = NULL;
struct stat stat_buf;
int max = 0;
retv_if(!dir_info, group_icon_info_list);
max = eina_list_count(group_icon_info_list);
- while ((dir_entry = readdir(dir_info))) {
+ while (!readdir_r(dir_info, &ent_struct, &dir_entry) && dir_entry) {
group_icon_info_s *group_icon_info = NULL;
char dir_path[PATH_LEN] = {0, };
char icon_path[PATH_LEN] = {0, };
{
icon_info_s *icon_info = NULL;
DIR *dir_info = NULL;
+ struct dirent ent_struct;
struct dirent *dir_entry = NULL;
int ret = 0;
dir_info = opendir(dir_path);
goto_if(!dir_info, error);
- while ((dir_entry = readdir(dir_info))) {
+ while (!readdir_r(dir_info, &ent_struct, &dir_entry) && dir_entry) {
icon_info_image_s *icon_info_image = NULL;
char *d_name = NULL;
char *filename = NULL;
char *ext = NULL;
char *tmp = NULL;
+ char *save_ptr = NULL;
char full_path[PATH_LEN] = {0, };
char thumbnail_file[PATH_LEN] = {0, };
struct stat stat_buf = {0, };
icon_info_image->file = strdup(full_path);
goto_if(!icon_info_image->file, not_sticker);
- filename = strtok(d_name, ".");
+ filename = strtok_r(d_name, ".", &save_ptr);
goto_if(!filename, not_sticker);
- ext = strtok(NULL, ".");
+ ext = strtok_r(NULL, ".", &save_ptr);
goto_if(!ext, not_sticker);
- tmp = strtok(filename, "_");
+ tmp = strtok_r(filename, "_", &save_ptr);
goto_if(!tmp, not_sticker);
if (!icon_info->keyword) {
goto_if(!icon_info->keyword, not_sticker);
}
- if ((tmp = strtok(NULL, "_"))) {
+ if ((tmp = strtok_r(NULL, "_", &save_ptr))) {
if (!strcmp(tmp, STICKER_IMG_NAME_TOKEN_SUB)) {
goto not_sticker;
} else if (!strcmp(tmp, STICKER_IMG_NAME_TOKEN_TH)) {
}
} else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info_image->diff_time = atoi(tmp);
else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->repeat = atoi(tmp);
else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->interval = atoi(tmp);
else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->play_type = atoi(tmp);
else goto next;
- if ((tmp = strtok(NULL, "_")))
+ if ((tmp = strtok_r(NULL, "_", &save_ptr)))
icon_info->th_frame = atoi(tmp);
next:
{
Eina_List *icon_info_list = NULL;
DIR *dir_info = NULL;
+ struct dirent ent_struct;
struct dirent *dir_entry = NULL;
struct stat stat_buf;
int ret = 0;
dir_info = opendir(dir_path);
retv_if(!dir_info, NULL);
- while ((dir_entry = readdir(dir_info))) {
+ while (!readdir_r(dir_info, &ent_struct, &dir_entry) && dir_entry) {
char icon_path[PATH_LEN] = {0, };
snprintf(icon_path, sizeof(icon_path), "%s/%s", dir_path, dir_entry->d_name);