Hacker News new | past | comments | ask | show | jobs | submit login

>So, you create something that does not fulfill the C library invariant of what constitutes a "string", and then pass it to a copy function that assumes this invariant? It isn't a fair thing to do

Well, life as a program is not fair either.

The problem is your function can be used in many contexts, including by other people. You should not expect them to be fair, you should make your function robust.

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