Skip to content
Snippets Groups Projects
Commit 9c60bb04 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

[*] renamed _dap_string_t to dap_string_t

[*] Replaced strtok() to strtok_r() for MT safe
parent 10eb929f
No related branches found
No related tags found
No related merge requests found
...@@ -236,7 +236,8 @@ dap_config_t * dap_config_open(const char * a_name) ...@@ -236,7 +236,8 @@ dap_config_t * dap_config_open(const char * a_name)
l_item->data_str_array = (char**) malloc (sizeof(char*) * l_item->array_length); l_item->data_str_array = (char**) malloc (sizeof(char*) * l_item->array_length);
// parsing items in array // parsing items in array
int j = 0; int j = 0;
char *token = strtok(values, ","); char * l_tmp = NULL;
char *token = strtok_r(values, ",",&l_tmp);
while(token) { while(token) {
// trim token whitespace // trim token whitespace
...@@ -248,7 +249,7 @@ dap_config_t * dap_config_open(const char * a_name) ...@@ -248,7 +249,7 @@ dap_config_t * dap_config_open(const char * a_name)
l_item->data_str_array[j] = strdup(token); l_item->data_str_array[j] = strdup(token);
token = strtok(NULL, ","); token = strtok_r(NULL, ",",&l_tmp);
j++; j++;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h>
typedef struct _dap_string dap_string_t; typedef struct _dap_string dap_string_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment