Use binary mode for file output
File output does not work properly on Windows, at least under MinGW. This is because
ao_open_file does not pass the
b flag to
fopen, and so the file is opened in text mode. A carriage return character is then inserted into the output file before each line feed character.
As noted here, applications can request binary mode by using the
In POSIX operating systems, the
b flag is ignored:
Therefore, it should be safe to add it here.