Commit e3821380 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

fix ProString::mid() without second parameter

we need to interpret the -1 as unsigned for it to mean "unlimited".

Change-Id: I130b809749fa1679a5b2444286baf48cc095c7bf
Reviewed-by: default avatarDaniel Teske <>
parent 662e6f11
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment