From 0b0681388d1bc2eab5daef9993ccd564825f5b9e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 25 Oct 2000 21:28:15 +0000 Subject: 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) --- source3/printing/lpq_parse.c | 9 +++------ 1 file 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) { -- cgit