apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu li <zeus19860...@yahoo.com.cn>
Subject function apr_strtok does not work..
Date Wed, 21 Mar 2007 08:23:08 GMT
i want to use apr_strtok to split the string.but it failed.

my_test.c:
#include <stdio.h>
#include "apr_strings.h"
int main(void)
{
        char *strToSplit = "Hello world";
        char *last;
        char *strResult;

        strResult = apr_strtok(strToSplit," ",&last);

        printf("%s\n",strResult);


        return 0;
}
it failed at apr_strtok.c line 51   **last = '\0';
The gdb infomation :
Program received signal SIGSEGV, Segmentation fault.
apr_strtok (str=0x80485d8 "Hello world", sep=0x80485e4 " ", last=0xbfff7740)
    at strings/apr_strtok.c:51
51              **last = '\0';

could  someone tell me the reason?
Thanks in advance.
 		
---------------------------------
 Mp3疯狂搜-新歌热歌高速下   
Mime
View raw message