Also remember that char may be signed or may not be signed. isprint() takes care of that, but c<=0x20 will behave unreliably.