bus error in strsep
Giorgos Keramidas
keramida at freebsd.org
Wed Jul 6 20:39:31 GMT 2005
On 2005-07-06 12:08, Maksim Yevmenkin <maksim.yevmenkin at savvis.net> wrote:
> Stefan,
>
> >int main(int argc, char* argv[])
> >{
> > char *c = "whats:your:name:buddy?";
> ^^^^^^^^^^^^^^^^ that is not read only copy. you can not write
> into it. replace it with
>
> char *c = strdup("whats:your:name:buddy?");
Or the following:
char c[] = "whats:your:name:buddy?";
which doesn't require a free() operation when you're done with c[].
More information about the freebsd-hackers
mailing list