prevent getting an outrageous index value, when a char is not found in a

given nsStr.  broke XPInstall.
This commit is contained in:
cathleen%netscape.com 1999-06-03 01:11:14 +00:00
parent 6542da1b5e
commit 19f3511bbb

View File

@ -359,7 +359,7 @@ inline PRInt32 RFindChar1(const char* aDest,PRUint32 aLength,PRUint32 anOffset,c
*/
inline PRInt32 RFindChar2(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) {
PRUnichar theCmpChar=(aIgnoreCase ? nsCRT::ToUpper(aChar) : aChar);
PRUint32 theIndex=0;
PRInt32 theIndex=0;
for(theIndex=aLength-1;theIndex>=0;theIndex--){
PRUnichar theChar=GetUnicharAt(aDest,theIndex);
if(aIgnoreCase)