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

No: if the function succeeds, the address of the NUL byte will always be !=end (as it must be inside of the buffer, which end is not); whereas, in the case of string truncation, cur will be equal to end, as the function returns dst+len (which is end); and, if that error had "already" happened during a previous call, it will get propagated through the next call as end-cur will be 0, causing the next call to immediately fail (even for a 0-length string, which is an important corner-case) and return cur+0 (which is still end).


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

Search: