Fix bug on architectures where char is unsigned.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764904