strtok() replaced with strtok_r()

This commit is contained in:
Daniel Stenberg
2001-05-29 19:17:39 +00:00
parent e0558ae541
commit d567659bf4
3 changed files with 9 additions and 6 deletions

View File

@@ -111,8 +111,9 @@ int Curl_parsenetrc(char *host,
file = fopen(netrcbuffer, "r");
if(file) {
char *tok;
char *tok_buf;
while(fgets(netrcbuffer, sizeof(netrcbuffer), file)) {
tok=strtok(netrcbuffer, " \t\n");
tok=strtok_r(netrcbuffer, " \t\n", &tok_buf);
while(tok) {
switch(state) {
case NOTHING:
@@ -163,7 +164,7 @@ int Curl_parsenetrc(char *host,
}
break;
} /* switch (state) */
tok = strtok(NULL, " \t\n");
tok = strtok_r(NULL, " \t\n", &tok_buf);
} /* while (tok) */
} /* while fgets() */