[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MIT discovered issue with gcc

Stefan Roas <sroas@roath.org> (2013-11-23):
> On Sat Nov 23, 2013 at 10:18:43, Robert Baron wrote:
> > Second question:
> > 
> > Doesn't memcpy allow for overlapping memory, but strcpy does not?  Isn't
> > this why memcpy is preferred over strcpy?
> Nope. There's memmove for overlapping areas.

Indeed, easy enough to check anyway, "opengroup memcpy" gives you:

Quoting it:
  The memcpy() function shall copy n bytes from the object pointed to by
  s2 into the object pointed to by s1. If copying takes place between
  objects that overlap, the behavior is undefined.


Attachment: signature.asc
Description: Digital signature

Reply to: