summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qutfcodec.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
commitc7934f2489e2eb9a539206bab35f335b1943c5bd (patch)
treea27d0ed6c001fe9432e2a0f28fb935acf9e4c65f /src/corelib/codecs/qutfcodec.cpp
parentf40593b11199fbef886bfcb6b210a214d8c3adf3 (diff)
parent08f9a1bd6ab9b1777ee5ba163d75e5c848c39eb4 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
Diffstat (limited to 'src/corelib/codecs/qutfcodec.cpp')
-rw-r--r--src/corelib/codecs/qutfcodec.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 98d4b2e4e3..a64b3d167e 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -296,7 +296,6 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
{
bool headerdone = false;
ushort replacement = QChar::ReplacementCharacter;
- int need = 0;
int invalid = 0;
int res;
uchar ch = 0;
@@ -311,7 +310,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
// 1 of 2 bytes invalid continuation +1 (need to insert replacement and restart)
// 2 of 3 bytes same +1 (same)
// 3 of 4 bytes same +1 (same)
- QString result(need + len + 1, Qt::Uninitialized);
+ QString result(len + 1, Qt::Uninitialized);
ushort *dst = reinterpret_cast<ushort *>(const_cast<QChar *>(result.constData()));
const uchar *src = reinterpret_cast<const uchar *>(chars);