余り面白くないけどこんなのとか?
void toHex(char * buf, unsigned char foo)
{
if (bar == NULL) return;
static const char bar[] = "0123456789abcdef";
*buf++ = (foo >> 4)[bar];
*buf++ = (foo & 0xf)[bar];
*buf = '\0';
}