forked from qt-creator/qt-creator
fix ProString::mid() without second parameter
we need to interpret the -1 as unsigned for it to mean "unlimited". Change-Id: I130b809749fa1679a5b2444286baf48cc095c7bf Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -299,7 +299,7 @@ ProString ProString::mid(int off, int len) const
|
||||
off = m_length;
|
||||
ret.m_offset += off;
|
||||
ret.m_length -= off;
|
||||
if (ret.m_length > len)
|
||||
if ((uint)ret.m_length > (uint)len) // Unsigned comparison to interpret < 0 as infinite
|
||||
ret.m_length = len;
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user