Re: libSystem.B.dylib Calling Code

2009-07-01 Thread Shawn Erickson
On Wed, Jul 1, 2009 at 3:18 PM, David Blanton wrote: > Here is code that crashes. the parms coming in are checked for validity > before ReplaceChar is called > > void ReplaceChar(char *s, char oldChar, char newChar) > { >    if(newChar == oldChar) >        return; >    char *n = strchr(s, oldChar);

libSystem.B.dylib Calling Code

2009-07-01 Thread David Blanton
Here is code that crashes. the parms coming in are checked for validity before ReplaceChar is called void ReplaceChar(char *s, char oldChar, char newChar) { if(newChar == oldChar) return; char *n = strchr(s, oldChar); while(n) { *n = newChar; n = strchr