summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_spoolss.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient/cmd_spoolss.c')
-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.