Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Since the loop copies data pointer by pointer, it can handle the case of overlapping data.

I don't think this loop does the right thing if destination points somewhere into source. It will start overwriting the non-copied parts of source.



It'll indeed. Copying data pointer-by-pointer has nothing to do with overlaps. One should iterate backwards to deal with overlapping.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: