Mathias Krause wrote:
for (i = 0; i < len; ++i)
if (!isprint(*s[i]))
s = "<GARBAGE>";
No offense,
None taken. We very much appreciate your contribution!
but isn't there a break missing in the loop when we assign s to be "<GARBAGE>"?
Yes. Good find. Thank you for spotting it!
Otherwise we may access invalid data if len is greater than strlen("<GARBAGE>") because we have changed the base we're looking at.
Yup. r1159
//Peter