3 ms·
> 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
by rini17 2y ago
> 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 ....
- foobiekr 2y agoForce is too strong a word. Yes, it's possible someone just passes whatever, or just passes strlen(s) which is an even dumber answer.