Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Compiler design in C? Date: Sat, 12 Nov 2016 17:20:00 -0800 Organization: None to speak of Lines: 30 Message-ID: References: <0915fef9-bb57-48b7-b98a-342f0e5ee39f@googlegroups.com> <98529082-11cc-b9a6-148f-70249943b502@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="91acebdd578691a4c37cc2222fdd265d"; logging-data="27328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Cy94CjDHv70Iu+NB/m5UW" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:KrDbdXngcvfIWLRgtJwF8buRm0M= sha1:8bOIruGLBKbJ2GNvlph8mcPR5hI= Xref: csiph.com comp.lang.c:96447 "James R. Kuyper" writes: > On 11/12/2016 05:33 PM, Keith Thompson wrote: >> "Chris M. Thomasson" writes: > ... >>> The only reason why I used "\r\n" in fscanf to parse the secret key file >>> is to mirror the fprintf that creates them here: >> [snip] >> >> Whatever the reason, it's misleading. >> >> And why are you using "\r\n" in printf? On a Unix-like system, it will >> print "\r\n"; on Windows, it will probably print "\r\r\n". Unless >> out_file is opened in binary mode. Is it? > > Look at the source code: everything is opened in binary mode. Ok, then that *could* make sense. It's unusual to use fprintf to write to a binary stream (or fwrite to write to a text stream), but it's perfectly valid. Except that, as Ben pointed out, printf writes to stdout, which is a text stream (unless you do something funny with freopen). [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"