From da738868ba5d2ba4b41faf271ad162747da73116 Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Mon, 1 Jan 2007 18:44:06 +0000 Subject: [PATCH] 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 --- src/kits/support/String.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp index 5803b586e7..55f2d548b4 100644 --- a/src/kits/support/String.cpp +++ b/src/kits/support/String.cpp @@ -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 */