Re: bus error in strsep

2005-07-07 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Dimitry Andric <[EMAIL PROTECTED]> typed: > On 2005-07-06 at 21:41:00 Stefan Sperling wrote: > > >> >>char *c = "whats:your:name:buddy?"; > >> made type. that should read "that is read only copy" :) > > Dark corners of C... So it's my own fault, as usual :) > > Actuall

Re: bus error in strsep

2005-07-07 Thread Maxime Henrion
Stefan Sperling wrote: > On Wed, Jul 06, 2005 at 12:10:23PM -0700, Maksim Yevmenkin wrote: > > Maksim Yevmenkin wrote: > > >>char *c = "whats:your:name:buddy?"; > > > > > > that is not read only copy. you can not write > > >into it. replace it with > > > > made

Re: bus error in strsep

2005-07-06 Thread Maksim Yevmenkin
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?"; whi

Re: bus error in strsep

2005-07-06 Thread Giorgos Keramidas
On 2005-07-06 12:08, Maksim Yevmenkin <[EMAIL PROTECTED]> 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:y

Re: bus error in strsep

2005-07-06 Thread Dimitry Andric
On 2005-07-06 at 21:41:00 Stefan Sperling wrote: >> >>char *c = "whats:your:name:buddy?"; >> made type. that should read "that is read only copy" :) > Dark corners of C... So it's my own fault, as usual :) Actually, this dark corner was enlightened not so long ago. String constants used to b

Re: bus error in strsep

2005-07-06 Thread Stefan Sperling
On Wed, Jul 06, 2005 at 12:10:23PM -0700, Maksim Yevmenkin wrote: > Maksim Yevmenkin wrote: > >>char *c = "whats:your:name:buddy?"; > > > > that is not read only copy. you can not write > >into it. replace it with > > made type. that should read "that is read o

Re: bus error in strsep

2005-07-06 Thread Maksim Yevmenkin
Maksim Yevmenkin 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 made type. that should read "that is read only copy" :) char *c = strdup("wh

Re: bus error in strsep

2005-07-06 Thread Maksim Yevmenkin
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?"); (void*)mystrsep(&c, ":"); } and it should work

bus error in strsep

2005-07-06 Thread Stefan Sperling
Hello hackers, I am getting a bus error in my application when I call strsep and it matches a character. It doesn't matter whether I call the strsep from my libc or a freshly compiled one, the error stays the same. This is my test case: $ cat strsep.c #define NULL ((void*)0) /* copied verbatim