Use a gint since fgetc returns an int. (#10417)

Should fix a warning on arm, and maybe other issues there..