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

"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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: