From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <199712012014.NAA14201@ellpspace.math.ualberta.ca> Date: Mon, 1 Dec 1997 13:14:09 -0700 (MST) From: Michal Jaegermann Subject: Re: Strange errors from strtok() In-Reply-To: <3.0.5.32.19971201130309.00913100@atlas> Rob Zook wrote: > I'm trying to use the strtok function from stdlib in a program and ^^^^^^^^^^^^^^^^^^^^ strtok() is not in stdlib > I get these strange errors: ...therefore errors are not strange at all. > [rzook@babylon5 cgi-bin]$ cc -o rsvp rsvp.c > rsvp.c: In function `main': > rsvp.c:20: warning: assignment makes pointer from integer without a cast > rsvp.c:25: warning: assignment makes pointer from integer without a cast strtok() is not declared, so compiler assumes a default 'int' as a type of a return value. You try to assign this to a pointer. This is a bug in your code. > /tmp/cca197261.o: In function `main': > rsvp.c(.text+0x8c): the `gets' function is dangerous and should not be used. Indeed! Anybody feeding your program a line longer than your buffer will crash it or worse (manipulating your stack one can make your program to execute any code at all). Big fun in a CGI context when you apparently are heading. Michal -- 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