Mail Archives: djgpp/1998/08/27/10:48:01
<HTML>
<TT>Mike Rusch wrote:</TT>
<BLOCKQUOTE TYPE=CITE><TT>Here's what I've done.</TT>
<BR><TT>First, I tried changing the effstrcpy function to this:</TT><TT></TT>
<P><TT>char *effstrcpy(char * &dest, const char *src) {</TT>
<BR><TT> int slen = strlen(src) + 1;</TT>
<BR><TT>// ---THE NEXT LINE IS LINE 71---</TT>
<BR><TT> malloc(sizeof(char) * slen];</TT></BLOCKQUOTE>
<TT>This line wouldn't compile because it ends in a ']' instead of a ')'
so this obviously isn't the code you ran! Try 'copy' then 'paste'
next time.</TT>
<BLOCKQUOTE TYPE=CITE><TT>I still got a SIGSEV on the malloc line.</TT></BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE><TT>The 01234567 after "What is your choice?" was
generated by debugging</TT>
<BR><TT>code I inserted just before the call to effstrcpy. It shows
that on the</TT>
<BR><TT>7th call the error occurred (just like before).</TT></BLOCKQUOTE>
<TT> Try making the smallest COMPLETE program which has
this problem, then post it in it's entirety here.</TT>
<BR><TT>--</TT>
<BR><TT> (\/) Endlisnis (\/)</TT>
<BR><TT> s257m AT unb DOT ca</TT>
<BR><TT> Endlisnis AT GeoCities DOT com</TT>
<BR><TT> Endlis AT nbnet DOT nb DOT ca</TT>
<BR><TT> </TT></HTML>
- Raw text -