diff options
author | David Tardon <dtardon@redhat.com> | 2014-04-19 18:47:49 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-04-19 22:30:18 +0200 |
commit | 7ea7ae1699d5b6c6a09d9227fd072868e58feb89 (patch) | |
tree | 162a1150198b2f7a9d73fac43a3dcad169922e15 | |
parent | c9e2ce548b218cca2b29060b62bcde66778391fb (diff) |
coverity#1202818 improper use of negative value
Change-Id: I2b5fed2f9f9d6a4aa6a8087843fa1805c2d1ffe4
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 2542b8dd089c..2d83ee4f1414 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2533,12 +2533,15 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam) { sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1); } - if (-1 == - (nBegin = sPart.indexOf(',',nEnd))) + if (-1 != nEnd) { - nBegin = sPart.indexOf(';',nEnd); + if (-1 == + (nBegin = sPart.indexOf(',',nEnd))) + { + nBegin = sPart.indexOf(';',nEnd); + } + nEnd = sPart.lastIndexOf(')'); } - nEnd = sPart.lastIndexOf(')'); if ((nBegin != -1) && (nEnd != -1)) { sText = sPart.copy(nBegin+1,nEnd-nBegin-1); |