summaryrefslogtreecommitdiff
path: root/source3/rpcclient
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/rpcclient
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/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index a7969bddd1..d98cb99276 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1222,9 +1222,10 @@ void set_drv_info_3_env (DRIVER_INFO_3 *info, const char *arch)
static char* get_driver_3_param (char* str, const char* delim, UNISTR* dest)
{
char *ptr;
+ char *saveptr;
/* get the next token */
- ptr = strtok(str, delim);
+ ptr = strtok_r(str, delim, &saveptr);
/* a string of 'NULL' is used to represent an empty
parameter because two consecutive delimiters
@@ -1251,7 +1252,8 @@ static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
{
char *str, *str2;
uint32 len, i;
-
+ char *saveptr;
+
/* fill in the UNISTR fields */
str = get_driver_3_param (args, ":", &info->name);
str = get_driver_3_param (NULL, ":", &info->driverpath);
@@ -1266,13 +1268,13 @@ static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
str = str2;
/* begin to strip out each filename */
- str = strtok(str, ",");
+ str = strtok_r(str, ",", &saveptr);
len = 0;
while (str != NULL)
{
/* keep a cumlative count of the str lengths */
len += strlen(str)+1;
- str = strtok(NULL, ",");
+ str = strtok_r(NULL, ",", &saveptr);
}
/* allocate the space; add one extra slot for a terminating NULL.