I suggest using ctype's isprint() instead. After all, what about the characters 0x7E and above?