Sujet : Re: Buffer contents well-defined after fgets() reaches EOF ?
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 11. Feb 2025, 23:44:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vogjse$1vo3l$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla Thunderbird
On 2/11/25 16:47, Lawrence D'Oliveiro wrote:
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.
I've no interest in de-facto standards. I'm only interested in de-jure
standards such as ISO/IEC 9899:2023. Feel free to have different
preferences.