bmf: explicitly cast fgetc result into a char