[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/53640: getnstr(3) shall read at most n characters, not n-1
The following reply was made to PR lib/53640; it has been noted by GNATS.
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
Subject: Re: lib/53640: getnstr(3) shall read at most n characters, not n-1
Date: Sat, 29 Sep 2018 16:46:42 +0300
On Sat, Sep 29, 2018 at 10:30:01 +0000, n54%gmx.com@localhost wrote:
> It's documented in POSIX to reat at most N bytes; but the NetBSD
> curses(3) version reads at most N-1 bytes.
I don't think that definition is precise enough. It doesn't
explicitly say if the buffer is NUL terminated on overflow.
> While the NetBSD curses(3) behavior might be defendable it diverges
> from the idiom of gets(3) + fgets(3). fgets(3) is documented to read
> at most N-1 characters and it does so.
Is it really that hard to explicitly quote the results you observe
with these tests? I find it rather disingenuous. Can't you
explicitly state your point?
Main Index |
Thread Index |