@@ -1418,11 +1418,11 @@ while (i < length) { of_unichar_t c; size_t clen; - clen = of_string_utf8_to_unicode(string + i, length - 1, &c); + clen = of_string_utf8_to_unicode(string + i, length - i, &c); if (clen == 0 || c > 0x10FFFF) { free(ret); @throw [OFInvalidEncodingException newWithClass: isa]; }