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

> It also forces discipline by carrying around the length.

LOL. It does not force anything - you can mishandle source or destination buffer lengths very easily and compiler won't say anything.

I sometimes wonder what kind of disaster will have to happen to make C programmers agree on a standard buffer (i.e. pointer+size) type with mandatory runtime bounds enforcement ....



Force is too strong a word. Yes, it's possible someone just passes whatever, or just passes strlen(s) which is an even dumber answer.




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

Search: