This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

re: strtok bug


On Thu, 13 Jan 2000 12:56:54 +0100 (CET) Clifford Wolf wrote:

>I'm currently porting ROCK Linux (www.rocklinux.org) to the PPC
>architecture. When porting telnetd (and some other packages) I found
>the following bug which doesn't seam to be architecture depended but
>only happens on PPC for me. Here is an example program:
>
>--snip--
>#include <string.h>
>
>int main() {
>        strtok("",":");    /* returns NULL */
>        strtok(NULL,":");  /* should return NULL - but dups core on ppc */
>}

I don't see anything in the ANSI C specification that would lead me to believe
that the above program's use of strtok is well defined.  Therefore the core
dumping behavior is just as acceptable as behavior that doesn't crash.

If you would like my detailed interpretation of ANSI/ISO 9899:1990 on this
matter, I'd be delighted to bore you to tears. ;)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]