From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <665372104d044459ef5ece7931d3194e.axp-list@archive.invalid> X-Archive-Original-Message-ID: <3.0.5.32.19971201141645.00b33210@atlas> Date: Mon, 01 Dec 1997 14:16:45 -0600 From: Rob Zook Subject: Re: Strange errors from strtok() In-Reply-To: <19971201115108.03468@dot.cygnus.com> At 11:51 AM 12/1/97 -0800, you wrote: >On Mon, Dec 01, 1997 at 01:03:09PM -0600, Rob Zook wrote: >> I'm trying to use the strtok function from stdlib in a program and >> I get these strange errors: > >Except that strtok isn't in , but in . Yup, adding "include " to my program removed the compile warnings, but I still got the strange behavior in my loop. When I tested this cgi, the postline string had a value of "name=Rob+Zook&extension=1111&guest=yes&beverage=beer" tokenPtr = strtok(postline,"&"); do { printf("TokenPtr = %s
\n", tokenPtr); } while((tokenPtr = strtok(NULL,"&"))==NULL); -----------------------------------------^^ And I goofed here. I should have said !=NULL. Haven't had to use a do-while loop in a while. Thanks to all who helped! Rob Z. -------------------------------------------------------- Not reaching a goal on a given day does not preclude reaching it tomorrow, or next year. One failure does not mean all is lost. Let it be motivation to improve, to deliver optimum performance in the next undertaking, whatever it may be - not to give up and quit trying. -- Capt. Spock -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com