Mail Archives: djgpp-workers/2003/01/11/07:38:19
Hello.
Eli Zaretskii wrote:
>
> > Date: Sat, 11 Jan 2003 09:57:00 +0000
> > From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> > >
> > > 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/ ]
- Raw text -