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

"aborting is correct: unexpected truncation is always a logic bug"

How does a function knows what a programmer expects... A lot of use for those potentially truncating functions are for display purpose, where truncating is expected and not a logic bug...

A library function potentially exiting is mostly useless.



And as the GP said, for those cases that truncating is expected (or not a problem) then use strncpy_s.




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

Search: