From 9684e16f002f4f813c49141de2933a7fb0c71461 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 27 Sep 2015 13:26:56 -0700 Subject: QUtf8Codec: Remove dead code The maximum value for charsNeeded is 4, so if bytesAvailable is less than charsNeeded - 1, the it's at most 2. It can't be larger than 2. Found by Coverity, CID 11000. Change-Id: I42e7ef1a481840699a8dffff1407ef9221a4fd80 Reviewed-by: Lars Knoll --- src/corelib/codecs/qutfcodec_p.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib/codecs') diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h index 99887352c9..d97145c6fc 100644 --- a/src/corelib/codecs/qutfcodec_p.h +++ b/src/corelib/codecs/qutfcodec_p.h @@ -217,8 +217,6 @@ namespace QUtf8Functions return Traits::Error; if (bytesAvailable > 1 && !isContinuationByte(Traits::peekByte(src, 1))) return Traits::Error; - if (bytesAvailable > 2 && !isContinuationByte(Traits::peekByte(src, 2))) - return Traits::Error; return Traits::EndOfString; } -- cgit v1.2.3