Re: [RFA] cli/cli-dump.c: Write dump always in binary mode on Cygwin

Andreas Schwab
2002-08-05T12:30:04Z

Corinna Vinschen <vinschen@redhat.com> writes:

|> Hi,
|>
|> the following patch solves a problem in the dump code in cli/cli-dump.c.
|> On systems which support binary and textmode file IO, the dump code
|> doesn't explicitly write in binary mode, resulting in files written
|> in textmode if that's the current default on the system. This leads
|> to a corrupted dump file since each LF is converted to CR/LF in the
|> file. The patch uses the "b" flag in the fopen(3) call to write
|> explicitly binary. Even if that flag is POSIX standard

It's not only POSIX C but already ISO C.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 NÃ¼rnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."