Fixed a bug where BString::FindLast(char,int32) might be fed an offset that was beyond the Length of the string.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Niels Sascha Reedijk 2007-01-01 18:44:06 +00:00
parent 1ea1a6b46e
commit da738868ba

View File

@ -984,7 +984,7 @@ BString::FindLast(char c, int32 beforeOffset) const
return B_ERROR;
const char *start = String();
const char *end = String() + beforeOffset;
const char *end = String() + min_clamp0(beforeOffset, Length());
/* Scans the string backwards until we found the character, */
/* or we reach the string's start */