Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3E200EAF.48FB3C6@phekda.freeserve.co.uk> Date: Sat, 11 Jan 2003 12:31:43 +0000 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: strlcat, strlcpy, revision 2 [PATCH] References: <4634-Fri10Jan2003223842+0200-eliz AT is DOT elta DOT co DOT il> <3E1FEA6C DOT 71BB41E7 AT phekda DOT freeserve DOT co DOT uk> <1659-Sat11Jan2003124106+0200-eliz AT is DOT elta DOT co DOT il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Eli Zaretskii wrote: > > > Date: Sat, 11 Jan 2003 09:57:00 +0000 > > From: Richard Dawe > > > > > > I might be forgetting something, but IIRC, strncat also always > > > nul-terminated the result, didn't it? > > > > Our implementation does, but not all do. > > Really? I thought the nul-termination by strncat was mandated by > ANSI C89, wasn't it? It's mandated by C99. I don't have a copy of C89 to check. > > Again, our implementation could be updated to cope with overlapping > > buffers. > > Doesn't it do that already? If not, what does it do? No. It uses strcpy and memcpy, which don't cope with overlaps. > > If our implementation were able to cope with overlapping buffers, I guess > > we could add that as a @port-note. But why tell people things like that? > > As I explained in another message, I think programmers should know > _exactly_ what does our implementation do in these cases. But that's > just my opinion; I wouldn't object to having the ``undefined > behavior'' text if others think it's appropriate. OK. Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]