Commit c575fe5f authored by Sebastian Ramacher's avatar Sebastian Ramacher

Use strtok_r instead of strtok

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 2c02dd97
......@@ -435,18 +435,25 @@ get_jumplist_from_str(const char* str)
girara_list_t* result = girara_list_new2(g_free);
char* copy = g_strdup(str);
char* token = strtok(copy, " ");
char* saveptr = NULL;
char* token = strtok_r(copy, " ", &saveptr);
while (token != NULL) {
zathura_jump_t* jump = g_malloc0(sizeof(zathura_jump_t));
jump->page = strtoul(token, NULL, 0);
token = strtok(NULL, " ");
token = strtok_r(NULL, " ", &saveptr);
if (token == NULL) {
girara_warning("Could not parse jumplist information.");
g_free(jump);
break;
}
jump->x = g_ascii_strtod(token, NULL);
token = strtok(NULL, " ");
token = strtok_r(NULL, " ", &saveptr);
jump->y = g_ascii_strtod(token, NULL);
girara_list_append(result, jump);
token = strtok(NULL, " ");
token = strtok_r(NULL, " ", &saveptr);
}
g_free(copy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment