Isn using some of the string library extensions such as strlcat and snprintf sufficient to overcome the main safety problems of char * buffer usage so as to make Bstrlib unnecessary?
A. No. String manipulation, by its very nature requires memory management to go hand in hand with each operation. These solutions do not provide any such thing and continue to defer the problem to the programmer. Arbitrary preconceived length cut-offs are just not adequate. It leads to the typical double problem of “make the buffer large enough for all reasonable cases” that just wastes memory in the most typical cases, while not functioning ideally at all in uncommon cases. Buffer overflows only represent the very worst problem with string support in the C/C++ languages. The other safety features in Bstrlib still give it a notable advantage versus any typical function augmentation based on the C library as a foundation. A survey of other modern programming languages also shows that a larger complement of string manipulation functions are required. Something that the C library or STL or its extensions does not provide.
Related Questions
- Isn using some of the string library extensions such as strlcat and snprintf sufficient to overcome the main safety problems of char * buffer usage so as to make Bstrlib unnecessary?
- What are the solutions to overcome the economical problems between central Asia and US?
- What is the main reason Japan cannot overcome its problems with the past?