> > + /* ignore optional '0x' prefix */ > > + if ((slen > 2) && (
Unnecessary (). > > + (0 == memcmp(s, "0x", 2) > > + || (0 == memcmp(s, "0X", 2))))) { A-about-F comparisons. > memcmp() is a really poor tool for comparing strings. You should use > strncasecmp() here. Even that is overkill, why not just: if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) David