Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Andrey Tarasevich Newsgroups: comp.lang.c Subject: Re: Buffer contents well-defined after fgets() reaches EOF ? Date: Sun, 9 Feb 2025 17:06:02 -0800 Organization: A noiseless patient Spider Lines: 13 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 10 Feb 2025 02:06:05 +0100 (CET) Injection-Info: dont-email.me; posting-host="4cfa0f591e14cf508d4f626503abd47b"; logging-data="956042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QAlqv9pAqNcimoOdWZCvK" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:u3+WjDCTMOPphcGuSTy0rgkLHtY= Content-Language: en-US In-Reply-To: Bytes: 1458 On Sun 2/9/2025 3:52 PM, Lawrence D'Oliveiro wrote: > On Sat, 8 Feb 2025 23:12:44 -0800, Andrey Tarasevich wrote: > >> If `fgets` reads nothing (instant end-of-file), the entire buffer >> remains untouched. > > You mean, only a single null byte gets written. No. The buffer is not changed at all in such case. -- Best regards, Andrey