Fix return value on platforms where char is unsigned.
Merge pull request #311 from trainman419/fix_unsigned_char

Fix return value on platforms where char is unsigned.