Replace char with unsigned char
char is not guaranteed to be byte, unsigned char should.