httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject Re: understanding apr_strtok()
Date Sat, 13 Dec 2008 07:35:32 GMT
Sam Carleton wrote:
> I am trying to use apr_strtok() for the first time.  I am taking the
> add_cookie() function from mod_rewrite.c, no changes.  I am passing in
> the string, variable 's':
> KioskViewingStation:KVS_VERSION::5
> The first line that executes in the function is:
>     char *tok_cntx;
>     var = apr_strtok(s, ":", &tok_cntx);
> I am getting an access violation.  I have tried initializing tok_cntx
> to NULL, but that does not seem to have any impact.  What is the
> correct way to use apr_strtok()?

This would be true if you don't bother to check if is NULL.  That is not
apr_strtok's job.


View raw message