From 04e6b22b257b3dd666f3db4439fdb9d1f9103775 Mon Sep 17 00:00:00 2001 From: "Kurt A. O'Hearn" <ohearnk@msu.edu> Date: Fri, 14 Aug 2020 14:01:57 -0400 Subject: [PATCH] PG-PuReMD: switch from using strtok_r to strtok to avoid reliance on GNU extensions with building for the C11/C++11 standard. --- PG-PuReMD/src/tool_box.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PG-PuReMD/src/tool_box.c b/PG-PuReMD/src/tool_box.c index e2ff498f..ea446a6a 100644 --- a/PG-PuReMD/src/tool_box.c +++ b/PG-PuReMD/src/tool_box.c @@ -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'; -- GitLab