summaryrefslogtreecommitdiffstats
path: root/src/xml/sax/qxml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/sax/qxml.cpp')
-rw-r--r--src/xml/sax/qxml.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index fe21bca810..1724076b84 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -1295,8 +1295,7 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText)
*needMoreText = false;
int l = text.length();
- const QString declStart = QStringLiteral("<?xml");
- const QStringRef snip = declStart.leftRef(l);
+ const QLatin1String snip("<?xml", std::min(l, 5));
if (l > 0 && !text.startsWith(snip))
return QString();