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

Haha, you're right, it's technically allowed for memcpy to call malloc in that circumstance.


memcpy wouldn't, but memmove would. memcpy doesn't check for or care about overlaps (and therefore the result is unpredictable - it'll depend on the implementation)




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

Search: