Skip to content
Snippets Groups Projects
Commit e9940d1b authored by Kitty Barnett's avatar Kitty Barnett
Browse files

- fixed : crash in rlvGetLastParenthesisedText() and...

- fixed : crash in rlvGetLastParenthesisedText() and rlvGetFirstParenthesisedText() (thankies Kadah)

--HG--
branch : RLVa
parent e85e93bb
No related branches found
No related tags found
No related merge requests found
......@@ -1128,9 +1128,9 @@ std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string
return std::string();
const char* pstrText = strText.c_str(); idxIt = idxStart;
while ( (cntLevel > 0) && (idxIt < strText.length()) )
while ( (cntLevel > 0) && (++idxIt < strText.length()) )
{
if ('(' == pstrText[++idxIt])
if ('(' == pstrText[idxIt])
cntLevel++;
else if (')' == pstrText[idxIt])
cntLevel--;
......@@ -1157,9 +1157,9 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string:
return std::string();
const char* pstrText = strText.c_str(); idxIt = idxEnd;
while ( (cntLevel > 0) && (idxIt >= 0) )
while ( (cntLevel > 0) && (--idxIt >= 0) && (idxIt < strText.length()) )
{
if (')' == pstrText[--idxIt])
if (')' == pstrText[idxIt])
cntLevel++;
else if ('(' == pstrText[idxIt])
cntLevel--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment