Deutsch   English   Français   Italiano  
<voblls$tfcn$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: Buffer contents well-defined after fgets() reaches EOF ?
Date: Mon, 10 Feb 2025 02:44:27 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <voblls$tfcn$1@dont-email.me>
References: <vo9g74$fu8u$1@dont-email.me> <vo9hlo$g0to$1@dont-email.me>
 <vo9khf$ggd4$1@dont-email.me> <vobf3h$sefh$2@dont-email.me>
 <vobjdt$t5ka$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Feb 2025 02:44:28 +0100 (CET)
Injection-Info: dont-email.me; posting-host="9a53b9bbf9924f168baa28a2e377f8a7";
	logging-data="966039"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18/4QubcsYpL17uHoAhC1Lw"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:UESNgd4H3nM4IWooyYGzJTTMhJ0=
In-Reply-To: <vobjdt$t5ka$1@dont-email.me>
Bytes: 1770

On 10.02.2025 02:06, Andrey Tarasevich wrote:
> 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.

This was actually what I feared some implementation might do
(unless it's specified by the "C" standard, which luckily is,
as has been shown and got quoted in this thread).

> No. The buffer is not changed at all in such case.

Which had been the good news.

Janis