Sujet : Re: Buffer contents well-defined after fgets() reaches EOF ?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 10. Feb 2025, 02:44:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <voblls$tfcn$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
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