Skip to content
Snippets Groups Projects
Commit d6ae28c5 authored by Umesh Vats's avatar Umesh Vats
Browse files

Bluetooth: KW fixes for banned API strtok

All occurrences of strtok replaced  with corresponding
reentrant verson, strtok_r

Change-Id: Ie38c512242fba3664d1da549c6eb696eb0fdcde1
parent e4643d19
No related branches found
No related tags found
No related merge requests found
...@@ -412,12 +412,13 @@ unsigned int ConfigFmThs :: extract_comma_sep_freqs ...@@ -412,12 +412,13 @@ unsigned int ConfigFmThs :: extract_comma_sep_freqs
) )
{ {
char *next_freq; char *next_freq;
char *saveptr = NULL;
unsigned int freq; unsigned int freq;
unsigned int *freqs_new_arr; unsigned int *freqs_new_arr;
unsigned int size = 0; unsigned int size = 0;
unsigned int len = 0; unsigned int len = 0;
next_freq = strtok(freqs, str); next_freq = strtok_r(freqs, str, &saveptr);
while(next_freq != NULL) { while(next_freq != NULL) {
freq = atoi(next_freq); freq = atoi(next_freq);
ALOGD("HYBRID_SRCH freq: %u\n", freq); ALOGD("HYBRID_SRCH freq: %u\n", freq);
...@@ -436,7 +437,7 @@ unsigned int ConfigFmThs :: extract_comma_sep_freqs ...@@ -436,7 +437,7 @@ unsigned int ConfigFmThs :: extract_comma_sep_freqs
} }
(*freqs_arr)[len] = freq; (*freqs_arr)[len] = freq;
len++; len++;
next_freq = strtok(NULL, str); next_freq = strtok_r(NULL, str, &saveptr);
} }
return len; return len;
} }
...@@ -449,12 +450,13 @@ unsigned int ConfigFmThs :: extract_comma_sep_sinrs ...@@ -449,12 +450,13 @@ unsigned int ConfigFmThs :: extract_comma_sep_sinrs
) )
{ {
char *next_sinr; char *next_sinr;
char *saveptr = NULL;
signed char *sinrs_new_arr; signed char *sinrs_new_arr;
unsigned int size = 0; unsigned int size = 0;
unsigned int len = 0; unsigned int len = 0;
signed char sinr; signed char sinr;
next_sinr = strtok(sinrs, str); next_sinr = strtok_r(sinrs, str, &saveptr);
while(next_sinr != NULL) { while(next_sinr != NULL) {
sinr = atoi(next_sinr); sinr = atoi(next_sinr);
ALOGD("HYBRID_SRCH sinr: %d\n", sinr); ALOGD("HYBRID_SRCH sinr: %d\n", sinr);
...@@ -473,7 +475,7 @@ unsigned int ConfigFmThs :: extract_comma_sep_sinrs ...@@ -473,7 +475,7 @@ unsigned int ConfigFmThs :: extract_comma_sep_sinrs
} }
(*sinrs_arr)[len] = sinr; (*sinrs_arr)[len] = sinr;
len++; len++;
next_sinr = strtok(NULL, str); next_sinr = strtok_r(NULL, str, &saveptr);
} }
return len; return len;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment