Fix style issue

This commit is contained in:
Matt Woenker 2024-08-06 15:53:49 -04:00
parent 704ec8dea6
commit 2a1ee419b4

View File

@ -150,20 +150,27 @@ void WriteBufferValidUTF8::finalizeImpl()
nextImpl(); nextImpl();
/// Handle remaining bytes if we have an incomplete sequence /// Handle remaining bytes if we have an incomplete sequence
if (working_buffer.begin() != memory.data()) { if (working_buffer.begin() != memory.data())
{
char * p = memory.data(); char * p = memory.data();
while (p < pos) { while (p < pos)
{
UInt8 len = length_of_utf8_sequence[static_cast<unsigned char>(*p)]; UInt8 len = length_of_utf8_sequence[static_cast<unsigned char>(*p)];
if (p + len > pos) { if (p + len > pos)
{
// Incomplete sequence. Skip one byte. // Incomplete sequence. Skip one byte.
putReplacement(); putReplacement();
++p; ++p;
} else if (Poco::UTF8Encoding::isLegal(reinterpret_cast<unsigned char *>(p), len)) { }
else if (Poco::UTF8Encoding::isLegal(reinterpret_cast<unsigned char *>(p), len))
{
// Valid sequence // Valid sequence
putValid(p, len); putValid(p, len);
p += len; p += len;
} else { }
else
{
// Invalid sequence, skip first byte. // Invalid sequence, skip first byte.
putReplacement(); putReplacement();
++p; ++p;