use var_long to write %ch

I missed folowing code is wrong. ch will be left-shifted.
fwrite( &ch, 2, 1, fp );

Prevent the left-shift.
var_long = ch;
fwrite( &var_long, 2, 1, fp );