Thanks to Jaroslav Kysela <perex@perex.cz> for providing the initial fix.
size_t i, p, n;
char *outbuf;
char name[1000];
- char *tmp, *path;
+ char *tmp, *tmp2, *path;
/* Load data */
outlen = spawn_and_store_stdout(XMLTV_FIND, NULL, &outbuf);
NULL
};
path = strdup(tmp);
- tmp = strtok(path, ":");
+ tmp = strtok_r(path, ":", &tmp2);
while (tmp) {
DIR *dir;
struct dirent *de;
}
closedir(dir);
}
- tmp = strtok(NULL, ":");
+ tmp = strtok_r(NULL, ":", &tmp2);
}
free(path);
}
/* Bundle */
#if ENABLE_BUNDLE
- char *tmp1 = strdup(path);
- char *tmp2 = strtok(tmp1, "/");
+ char *tmp1, *tmp2, *tmp3;
+ *tmp1 = strdup(path);
+ *tmp2 = strtok_r(tmp1, "/", &tmp3);
filebundle_entry_t *fb = filebundle_root;
while (fb && tmp2) {
if (fb->type == FB_DIR && !strcmp(fb->name, tmp2)) {
- tmp2 = strtok(NULL, "/");
+ tmp2 = strtok_r(NULL, "/", &tmp3);
if (tmp2) fb = fb->d.child;
} else {
fb = fb->next;
{
int ret = 0;
char bin[512];
- char *path, *tmp;
+ char *path, *tmp, *tmp2;
DIR *dir;
struct dirent *de;
struct stat st;
if (!(path = getenv("PATH"))) return 0;
path = strdup(path);
- tmp = strtok(path, ":");
+ tmp = strtok_r(path, ":", &tmp2);
while (tmp && !ret) {
if ((dir = opendir(tmp))) {
while ((de = readdir(dir))) {
}
closedir(dir);
}
- tmp = strtok(NULL, ":");
+ tmp = strtok_r(NULL, ":", &tmp2);
}
free(path);
return ret;
if((s = htsmsg_get_str(c, "epggrabsrc")) != NULL) {
char *tmp = strdup(s);
- char *sptr = NULL;
+ char *sptr, *sptr2;
char *modecid = strtok_r(tmp, ",", &sptr);
char *modid, *ecid;
epggrab_module_t *mod;
/* Add new */
while (modecid) {
- modid = strtok(modecid, "|");
- ecid = strtok(NULL, "|");
+ modid = strtok_r(modecid, "|", &sptr2);
+ ecid = strtok_r(NULL, "|", &sptr2);
modecid = strtok_r(NULL, ",", &sptr);
if (!(mod = epggrab_module_find_by_id(modid)))