瀏覽代碼

Utf8View: Don't print potentially unterminated string in debug message

Andreas Kling 5 年之前
父節點
當前提交
9f99e285d1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      AK/Utf8View.cpp

+ 1 - 1
AK/Utf8View.cpp

@@ -148,7 +148,7 @@ u32 Utf8CodepointIterator::operator*() const
 
 
     bool first_byte_makes_sense = decode_first_byte(m_ptr[0], codepoint_length_in_bytes, codepoint_value_so_far);
     bool first_byte_makes_sense = decode_first_byte(m_ptr[0], codepoint_length_in_bytes, codepoint_value_so_far);
     if (!first_byte_makes_sense) {
     if (!first_byte_makes_sense) {
-        dbg() << "First byte doesn't make sense, bytes = " << (const char*)m_ptr;
+        dbg() << "First byte doesn't make sense, bytes: " << StringView((const char*)m_ptr, m_length);
     }
     }
     ASSERT(first_byte_makes_sense);
     ASSERT(first_byte_makes_sense);
     if (codepoint_length_in_bytes > m_length) {
     if (codepoint_length_in_bytes > m_length) {