Fix return value on platforms where char is unsigned.