50134: check offset before calling CharAt(offset-1). r=mcafee

This commit is contained in:
akkana%netscape.com 2000-08-30 01:42:27 +00:00
parent 4b4727fb8e
commit 719f67e1c8
2 changed files with 2 additions and 2 deletions

View File

@ -521,7 +521,7 @@ StripCommentDelimiters(nsString& aCommentString)
}
offset = aCommentString.RFind(kCommentEnd);
if (-1 != offset) {
if (offset > 0) {
// Take up to 1 more '-'
if (kMinus == aCommentString.CharAt(offset-1)) {
offset--;

View File

@ -521,7 +521,7 @@ StripCommentDelimiters(nsString& aCommentString)
}
offset = aCommentString.RFind(kCommentEnd);
if (-1 != offset) {
if (offset > 0) {
// Take up to 1 more '-'
if (kMinus == aCommentString.CharAt(offset-1)) {
offset--;