4 ms·
Is there a good string handling library for C?
by plumeria 13y ago
Is there a good string handling library for C?
- nitrogen 13y agoOther HNers have recommended bstring. I haven't tried it myself. http://bstring.sourceforge.net/ http://bstring.sourceforge.net/
- clarry 13y agoBString relies on undefined behavior for security: The reason is it is resiliant to length overflows is that bstring lengths are bounded above by INT_MAX, instead of ~(size_t)0. So length addition overflows cause a wrap around of the integer value making them negative causing balloc() to fail before an erroneous operation can occurr. I wouldn't touch this library.