Modified nsString2::Append to only call strlen only if aCount is -1.

This clears up ABR errors reported in Purify.


git-svn-id: svn://10.0.0.236/trunk@31517 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kmcclusk%netscape.com
1999-05-13 23:44:57 +00:00
parent 873621e397
commit 48e71616c3
4 changed files with 16 additions and 16 deletions

View File

@@ -829,8 +829,8 @@ nsString2& nsString2::Append(const char* aCString,PRInt32 aCount) {
nsStr temp;
Initialize(temp,eOneByte);
temp.mStr=(char*)aCString;
temp.mLength=nsCRT::strlen(aCString);
if(-1==aCount) aCount=temp.mLength;
if(-1==aCount) aCount= nsCRT::strlen(aCString);
temp.mLength = aCount;
nsStr::Append(*this,temp,0,aCount,mAgent);
}
return *this;
@@ -848,8 +848,8 @@ nsString2& nsString2::Append(const PRUnichar* aString,PRInt32 aCount) {
nsStr temp;
Initialize(temp,eTwoByte);
temp.mUStr=(PRUnichar*)aString;
temp.mLength=nsCRT::strlen(aString);
if(-1==aCount) aCount=temp.mLength;
if(-1==aCount) aCount= nsCRT::strlen(aString);
temp.mLength = aCount;
nsStr::Append(*this,temp,0,aCount,mAgent);
}
return *this;