Date: Wed, 6 Jul 2005 23:39:24 +0300 From: Giorgos Keramidas <keramida@freebsd.org> To: Maksim Yevmenkin <maksim.yevmenkin@savvis.net> Cc: freebsd-hackers@freebsd.org, Stefan Sperling <stsp@stsp.in-berlin.de> Subject: Re: bus error in strsep Message-ID: <20050706203924.GB6160@gothmog.gr> In-Reply-To: <42CC2C36.7090003@savvis.net> References: <20050706185536.GA4700@dice.seeling33.de> <42CC2C36.7090003@savvis.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-07-06 12:08, Maksim Yevmenkin <maksim.yevmenkin@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[].
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050706203924.GB6160>