3 ms·
I'm pretty sure the its very hard refers to string handling in C, and also fairly solid in my agreement that unless you have a very very good reason, that is on
by shadowmint 13y ago
I'm pretty sure the its very hard refers to string handling in C, and also fairly solid in my agreement that unless you have a very very good reason, that is one of the places most people are better off staying away from (especially once you start playing with C unicode constructs).
(but your point is totally valid with regard to C in general~)
- plumeria 13y agoIs 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.