summaryrefslogtreecommitdiff
path: root/source3/lib/afs_settoken.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-23 11:04:10 +0100
committerVolker Lendecke <vl@samba.org>2008-01-23 15:08:04 +0100
commit587cf54c61c9f1f7bcae431a82035fd942716c32 (patch)
treec11ebe9ab6ed860e7e768b1b7de4db3c8ac609a1 /source3/lib/afs_settoken.c
parent20512431321388cf293431b942cbbe9263d295c9 (diff)
downloadsamba-587cf54c61c9f1f7bcae431a82035fd942716c32.tar.gz
samba-587cf54c61c9f1f7bcae431a82035fd942716c32.tar.bz2
samba-587cf54c61c9f1f7bcae431a82035fd942716c32.zip
strtok -> strtok_r
(This used to be commit fd34ce437057bb34cdc37f4b066e424000d36789)
Diffstat (limited to 'source3/lib/afs_settoken.c')
-rw-r--r--source3/lib/afs_settoken.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/source3/lib/afs_settoken.c b/source3/lib/afs_settoken.c
index aeef1c3520..444f09efca 100644
--- a/source3/lib/afs_settoken.c
+++ b/source3/lib/afs_settoken.c
@@ -53,20 +53,21 @@ static bool afs_decode_token(const char *string, char **cell,
{
DATA_BLOB blob;
struct ClearToken result_ct;
+ char *saveptr;
char *s = SMB_STRDUP(string);
char *t;
- if ((t = strtok(s, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(s, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
*cell = SMB_STRDUP(t);
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
@@ -75,8 +76,8 @@ static bool afs_decode_token(const char *string, char **cell,
return False;
}
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
@@ -93,8 +94,8 @@ static bool afs_decode_token(const char *string, char **cell,
data_blob_free(&blob);
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
@@ -103,8 +104,8 @@ static bool afs_decode_token(const char *string, char **cell,
return False;
}
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
@@ -113,8 +114,8 @@ static bool afs_decode_token(const char *string, char **cell,
return False;
}
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}
@@ -123,8 +124,8 @@ static bool afs_decode_token(const char *string, char **cell,
return False;
}
- if ((t = strtok(NULL, "\n")) == NULL) {
- DEBUG(10, ("strtok failed\n"));
+ if ((t = strtok_r(NULL, "\n", &saveptr)) == NULL) {
+ DEBUG(10, ("strtok_r failed\n"));
return False;
}