Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: Buffer contents well-defined after fgets() reaches EOF ? Date: Wed, 12 Feb 2025 06:16:22 -0000 (UTC) Organization: A noiseless patient Spider Lines: 17 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 12 Feb 2025 07:16:23 +0100 (CET) Injection-Info: dont-email.me; posting-host="bb7caed71241890f8fb0f019c2e611ec"; logging-data="2339808"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19828ymYHQUi0ewgafT8lwk" User-Agent: Pan/0.161 (Chasiv Yar; ) Cancel-Lock: sha1:uVgWqEQ05peJQUUlSJI2gXwRTFU= Bytes: 2018 On Tue, 11 Feb 2025 17:44:30 -0500, James Kuyper wrote: > 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. Where is there an implementation that conforms to that?