diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-05-29 19:17:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-05-29 19:17:39 +0000 |
commit | d567659bf4003c0808c309a52100a32a82a4b128 (patch) | |
tree | 1d51d055db3cb063c8186d49c8000e6a71cc7134 /lib/cookie.c | |
parent | e0558ae541d94c1d183d2cb67c5edf120ba6974b (diff) |
strtok() replaced with strtok_r()
Diffstat (limited to 'lib/cookie.c')
-rw-r--r-- | lib/cookie.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cookie.c b/lib/cookie.c index 6fa35d783..f15a3223e 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -199,6 +199,7 @@ Curl_cookie_add(struct CookieInfo *c, /* This line is NOT a HTTP header style line, we do offer support for reading the odd netscape cookies-file format here */ char *firstptr; + char *tok_buf; int fields; if(lineptr[0]=='#') { @@ -214,7 +215,7 @@ Curl_cookie_add(struct CookieInfo *c, if(ptr) *ptr=0; /* clear it */ - firstptr=strtok(lineptr, "\t"); /* first tokenize it on the TAB */ + firstptr=strtok_r(lineptr, "\t", &tok_buf); /* first tokenize it on the TAB */ /* Here's a quick check to eliminate normal HTTP-headers from this */ if(!firstptr || strchr(firstptr, ':')) { @@ -224,7 +225,7 @@ Curl_cookie_add(struct CookieInfo *c, /* Now loop through the fields and init the struct we already have allocated */ - for(ptr=firstptr, fields=0; ptr; ptr=strtok(NULL, "\t"), fields++) { + for(ptr=firstptr, fields=0; ptr; ptr=strtok_r(NULL, "\t", &tok_buf), fields++) { switch(fields) { case 0: co->domain = strdup(ptr); |