On 30/07/2020 18:37, Joel Sherrill wrote: > My recollection is that memcpy is undefined on overlapping memory regions. Yes. > You should use memmove. > > A bigger question is why do these overlap and the code still thinks > the copy is > needed. strncpy() has the same problem with overlapping strings.