On Fri, 2010-04-30 at 12:07 -0700, Andrew Morton wrote:> I had to fiddle with it:> - use tolower(), saving 3 bytes!tolower could be done after the 0-9 case as wellint hex_to_bin(char ch){ if ((ch >= '0') && (ch <= '9')) return ch - '0'; ch = tolower(ch); if ((ch >= 'a') && (ch <= 'f')) return ch - 'a' + 10; return -1;}