Yes, he is returning a *signed* char from HexDigit, whereas unsigned chars are used in the rest of the logic. I think it's a typo?