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

Re: MIT discovered issue with gcc



Robert Baron <robertbartlettbaron@gmail.com> writes:

> Second question:
>
> Doesn't memcpy allow for overlapping memory, but strcpy does not?  Isn't this
> why memcpy is preferred over strcpy?

According to the man page for memcpy, "The memory areas must not
overlap.  Use memmove(3)  if  the memory areas do overlap."

strcpy will stop copying at the first null byte.


Reply to: