This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
re: strtok bug
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: re: strtok bug
- From: Kaz Kylheku <kaz at ashi dot footprints dot net>
- Date: Thu, 13 Jan 2000 19:15:27 -0800 (PST)
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. ;)