In g2c_file_io(), define chat *bvar as signed char. The generic char on majority of platforms is signed, except ARM Linux where it is unsigned.