Overview
Comment: | OFString_UTF8: Improved range checks |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0b962df002af925d65cfa70859a3df6e |
User & Date: | js on 2019-04-22 16:53:51 |
Other Links: | manifest | tags |
Context
2019-04-23
| ||
00:12 | OFSystemInfo: Add +[CPUModel] check-in: 2447bb2967 user: js tags: trunk | |
2019-04-22
| ||
16:53 | OFString_UTF8: Improved range checks check-in: 0b962df002 user: js tags: trunk | |
09:17 | OFSystemInfo: AltiVec detection for AmigaOS 4 check-in: 7ef650a6ec user: js tags: trunk | |
Changes
Modified src/OFMutableString_UTF8.m from [afad633464] to [8884971f0c].
︙ | |||
203 204 205 206 207 208 209 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - + | size_t lenNew; ssize_t lenOld; if (_s->isUTF8) idx = of_string_utf8_get_position(_s->cString, idx, _s->cStringLength); |
︙ |
Modified src/OFString.m from [fd85923ed1] to [8cbfa26fc2].
︙ | |||
261 262 263 264 265 266 267 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - + | return 0; } ssize_t of_string_utf8_decode(const char *buffer_, size_t length, of_unichar_t *ret) { |
︙ |
Modified src/OFString_UTF8.m from [b5bfc583a1] to [c33b1359c4].
︙ | |||
163 164 165 166 167 168 169 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - + | size_t of_string_utf8_get_position(const char *string, size_t idx, size_t length) { for (size_t i = 0; i <= idx; i++) if OF_UNLIKELY ((string[i] & 0xC0) == 0x80) if (++idx > length) |
︙ |
Modified src/macros.h from [6558af17e7] to [989f46865e].
︙ | |||
89 90 91 92 93 94 95 | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - - + + | # define OF_LIKELY(cond) (__builtin_expect(!!(cond), 1)) # define OF_UNLIKELY(cond) (__builtin_expect(!!(cond), 0)) # define OF_CONST_FUNC __attribute__((__const__)) # define OF_NO_RETURN_FUNC __attribute__((__noreturn__)) # define OF_WEAK_REF(sym) __attribute__((__weakref__(sym))) #else # define OF_INLINE inline |
︙ |