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);
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