To avoid compilation error on some versions of gcc the
saveptr for strtok_r needs to be initilised to NULL.
Change-Id: I7b30e51ecae33a6994ba7ea181cac0f33eef023f
Signed-off-by: Kamil Wiatrowski <kamilx.wiatrowski@intel.com>
if (!events)
return -1;
- char *s, *tmp;
+ char *s, *tmp = NULL;
for (s = strtok_r(events, ",", &tmp); s; s = strtok_r(NULL, ",", &tmp)) {
/* Allocate memory for event struct that contains array of efd structs
* Number of elements placed into nums.
*/
static size_t str_list_to_nums(char *s, unsigned *nums, size_t nums_len) {
- char *saveptr;
+ char *saveptr = NULL;
char *token;
size_t idx = 0;