Sujet : Re: Buffer contents well-defined after fgets() reaches EOF ?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 11. Feb 2025, 22:47:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <voggh9$1v580$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.161 (Chasiv Yar; )
On Tue, 11 Feb 2025 13:07:53 -0500, James Kuyper wrote:
I just tried it, using gcc and found that fgets() does set the first
byte of the buffer to a null character. Therefore, it doesn't conform to
the requirements of the standard.
GCC is, however, the closest thing we have to a de-facto standard for C.
Is there another C compiler/runtime that behaves different?