summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-25 21:28:15 +0000
committerJeremy Allison <jra@samba.org>2000-10-25 21:28:15 +0000
commit0b0681388d1bc2eab5daef9993ccd564825f5b9e (patch)
tree9179c4c89d0bdd2674c92ae0c55a4c1b5bf8c14a
parent7b1cf88670b8c8a63fd9104c1fd8c45c80d3b321 (diff)
downloadsamba-0b0681388d1bc2eab5daef9993ccd564825f5b9e.tar.gz
samba-0b0681388d1bc2eab5daef9993ccd564825f5b9e.tar.bz2
samba-0b0681388d1bc2eab5daef9993ccd564825f5b9e.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. (This used to be commit c3e4ac9a2db32c40ce330de0eab4bc82ef4fd579)
-rw-r--r--source3/printing/lpq_parse.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source3/printing/lpq_parse.c b/source3/printing/lpq_parse.c
index 4a4cf6306b..e0b3ed192f 100644
--- a/source3/printing/lpq_parse.c
+++ b/source3/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) {