forked from qt-creator/qt-creator
QmlProfiler: Don't add junk to the end of strings from QmlEvents
The UTF-8 data stored in the event is not necessarily null-terminated. Change-Id: Id5d4f0b50f8c7c70aa6576121905072984f1c342 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -159,9 +159,9 @@ struct QmlEvent {
|
||||
{
|
||||
switch (m_dataType) {
|
||||
case External8Bit:
|
||||
return QString::fromUtf8(static_cast<const char *>(m_data.external));
|
||||
return QString::fromUtf8(static_cast<const char *>(m_data.external), m_dataLength);
|
||||
case Inline8Bit:
|
||||
return QString::fromUtf8(m_data.internalChar);
|
||||
return QString::fromUtf8(m_data.internalChar, m_dataLength);
|
||||
default:
|
||||
Q_UNREACHABLE();
|
||||
return QString();
|
||||
|
||||
Reference in New Issue
Block a user