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 <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
da5b8bfe46
commit
9684e16f00
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user