This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Crush in strtok
- To: egcs-bugs at cygnus dot com
- Subject: Crush in strtok
- From: Igor Levko <hornet at reksoft dot ru>
- Date: Wed, 08 Jul 1998 13:34:36 +0400
- Organization: Reksoft ltd.
Hello,
I have gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
for Solaris 2.5.1.
Having compiled this simplest test I invoked it and got
segmentation fault.
#include <stdio.h>
#include <string.h>
int main()
{
char* str = "one two three";
char* ptr = strtok(str, " ");
while (ptr)
{
printf("[%s]\n", ptr);
ptr = strtok(NULL, " ");
}
return 1;
}
gdb said that the exeption had taken place somewhere in strtok_r call.
I'm not sure if it's the compiler's bug but I tryed some other compilers
and everything was fine.
Best regards,
Igor Levko
e-mail:hornet@reksoft.ru