Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Audit and replace all ctype.h uses | wm4 | 2014-07-01 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | Something like "char *s = ...; isdigit(s[0]);" triggers undefined behavior, because char can be signed, and thus s[0] can be a negative value. The is*() functions require unsigned char _or_ EOF. EOF is a special value outside of unsigned char range, thus the argument to the is*() functions can't be a char. This undefined behavior can actually trigger crashes if the implementation of these functions e.g. uses lookup tables, which are then indexed with out-of-range values. Replace all <ctype.h> uses with our own custom mp_is*() functions added with misc/ctype.h. As a bonus, these functions are locale-independent. (Although currently, we _require_ C locale for other reasons.) | ||||
* | bstr: add function for splitting UTF-8 | wm4 | 2014-01-15 | 2 | -1/+18 |
| | |||||
* | bstr: check for overflow in buffer allocation | wm4 | 2014-01-03 | 1 | -0/+4 |
| | | | | | We're being a little bit lazy here and limit the max allocation to SIZE_MAX/2, which is practically infinite anyway on 64 bit systems. | ||||
* | bstr: use mp_append_utf8_bstr() | wm4 | 2013-12-30 | 1 | -19/+4 |
| | | | | Drop usage of the ugly PUT_UTF8() macro. | ||||
* | bstr: add bstr_xappend function | wm4 | 2013-12-30 | 2 | -0/+59 |
| | | | | | | Apparently this can be really useful when being paranoid and trying to avoid too much malloc/realloc, since it can be used to appending into a buffer (with transparent realloc only if the buffer is too small). | ||||
* | Split mpvcore/ into common/, misc/, bstr/ | wm4 | 2013-12-17 | 2 | -0/+585 |