use (signed char) instead of (char), this fixes for platforms that treat char as unsigned by default