Skip to content

Commit 35242f3

Browse files
author
mr.fantastic
committed
openfx module: replace strtok with strtok_r to parse openfx plugin paths from environment variable
1 parent 698a78b commit 35242f3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/modules/openfx/factory.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,12 @@ MLT_REPOSITORY
166166

167167
if (openfx_path) {
168168
int dli = 0;
169+
char *saveptr, *strptr;
169170

170-
for (dir = strtok(openfx_path, MLT_DIRLIST_DELIMITER); dir;
171-
dir = strtok(NULL, MLT_DIRLIST_DELIMITER)) {
171+
for (strptr = openfx_path;; strptr = NULL) {
172+
dir = strtok_r(strptr, MLT_DIRLIST_DELIMITER, &saveptr);
173+
if (dir == NULL)
174+
break;
172175
size_t dir_len = strlen(dir);
173176

174177
DIR *d = opendir(dir);

0 commit comments

Comments
 (0)