Skip to content
Snippets Groups Projects
Commit 04e6b22b authored by Kurt A. O'Hearn's avatar Kurt A. O'Hearn
Browse files

PG-PuReMD: switch from using strtok_r to strtok to avoid reliance on GNU...

PG-PuReMD: switch from using strtok_r to strtok to avoid reliance on GNU extensions with building for the C11/C++11 standard.
parent 793d4e24
No related branches found
No related tags found
No related merge requests found
......@@ -284,13 +284,13 @@ int Tokenize( char* s, char*** tok, size_t token_len )
int count = 0;
char test[MAX_LINE];
char *sep = "\t \n!=";
char *word, *saveptr;
char *word;
strncpy( test, s, sizeof(test) - 1 );
test[sizeof(test) - 1] = '\0';
for ( word = strtok_r(test, sep, &saveptr); word != NULL;
word = strtok_r(NULL, sep, &saveptr) )
for ( word = strtok(test, sep); word != NULL;
word = strtok(NULL, sep) )
{
strncpy( (*tok)[count], word, token_len - 1 );
(*tok)[count][token_len - 1] = '\0';
......
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