#9 if expression never true

open
nobody
None
5
2014-07-15
2009-10-25
Frederico Costa
No

in AtomicParsley.cpp, between lines 3042 and 3036:

uint32_t raw_bytes = strlen(unicode_data);
total_bytes = utf8_length(unicode_data, 255); //counts the number of characters, not bytes

if (raw_bytes > total_bytes && total_bytes > 255) {

The if will always be false, as the maximum from the utf8_length of total_byes will be 255, so it can never be bigger than 255, making the expression always false, and of course not trimming the text.

Discussion