On Page 78, in the removeChars code, an error occurs:
Code:
for( src = 0; src < len; ++src ){
flags[r[src]] = true;
}
However, at this point in the code,
len refers to the length of
s, also the length of
str.
Instead, it should use the length of
r, so as to not walk past the end of the
r array.
For instance:
Code:
int lenr = r.Length;
for( src = 0; src < lenr; ++src ){
flags[r[src]] = true;
}
Regards,
-Matt