summaryrefslogtreecommitdiffstats
path: root/source/printing/lpq_parse.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-25 21:28:38 +0000
committerJeremy Allison <jra@samba.org>2000-10-25 21:28:38 +0000
commitf01140f8f3307f5eeac53a7743a735a826e71d57 (patch)
tree1b40841a86380da67ee9cfe6ebf82c8cb5c4b0f9 /source/printing/lpq_parse.c
parenta91ad4bd5d8532c5a243a9fbee38fd078955a768 (diff)
downloadsamba-f01140f8f3307f5eeac53a7743a735a826e71d57.tar.gz
samba-f01140f8f3307f5eeac53a7743a735a826e71d57.tar.xz
samba-f01140f8f3307f5eeac53a7743a735a826e71d57.zip
We already have a perfectly good next_token() function we should be using
instead of strtok - this fixes a bug with NT users with spaces in their names when using winbindd. Needs to be added to the other parse_lpXX functions (currently only added to lprng parsing code). Jeremy.
Diffstat (limited to 'source/printing/lpq_parse.c')
-rw-r--r--source/printing/lpq_parse.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/printing/lpq_parse.c b/source/printing/lpq_parse.c
index 4a4cf6306bf..e0b3ed192f8 100644
--- a/source/printing/lpq_parse.c
+++ b/source/printing/lpq_parse.c
@@ -218,18 +218,15 @@ static BOOL parse_lpq_lprng(char *line,print_queue_struct *buf,BOOL first)
#define LPRNG_NTOK 7
#define LPRNG_MAXTOK 128 /* PFMA just to keep us from running away. */
- char *tokarr[LPRNG_MAXTOK];
+ fstring tokarr[LPRNG_MAXTOK];
char *cptr;
int num_tok = 0;
pstring line2;
pstrcpy(line2,line);
- tokarr[0] = strtok(line2," \t");
- num_tok++;
- while (((tokarr[num_tok] = strtok(NULL," \t")) != NULL)
- && (num_tok < LPRNG_MAXTOK)) {
+ cptr = line2;
+ while(next_token( &cptr, tokarr[num_tok], " \t", sizeof(fstring)) && (num_tok < LPRNG_MAXTOK))
num_tok++;
- }
/* We must get at least LPRNG_NTOK tokens. */
if (num_tok < LPRNG_NTOK) {