Fix for the bug [ID: 2906315]: < instead != in utf8to32

git-svn-id: http://svn.code.sf.net/p/utfcpp/code@107 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
ntrifunovic 2009-12-07 01:34:23 +00:00 committed by King_DuckZ
parent 4878ddc7e5
commit 7c41f51d56
2 changed files with 2 additions and 2 deletions

View file

@ -249,7 +249,7 @@ namespace utf8
template <typename octet_iterator, typename u32bit_iterator>
u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
{
while (start < end)
while (start != end)
(*result++) = next(start, end);
return result;

View file

@ -144,7 +144,7 @@ namespace utf8
template <typename u16bit_iterator, typename octet_iterator>
u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
{
while (start != end) {
while (start < end) {
uint32_t cp = next(start);
if (cp > 0xffff) { //make a surrogate pair
*result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);