Fix for bug #ID: 2857456[redundant checks in append in checked.h]
git-svn-id: http://svn.code.sf.net/p/utfcpp/code@102 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
parent
8f19d3aa84
commit
cb757aff4f
1 changed files with 1 additions and 4 deletions
|
@ -120,15 +120,12 @@ namespace utf8
|
||||||
*(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
|
*(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
|
||||||
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
|
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
|
||||||
}
|
}
|
||||||
else if (cp <= internal::CODE_POINT_MAX) { // four octets
|
else { // four octets
|
||||||
*(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
|
*(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
|
||||||
*(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
|
*(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f) | 0x80);
|
||||||
*(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
|
*(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
|
||||||
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
|
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
throw invalid_code_point(cp);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue