WIP for new string library, and defensive coding improvement in SetCapcity; r=buster
git-svn-id: svn://10.0.0.236/trunk@64014 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -175,7 +175,7 @@ void nsCString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
/**
|
||||
* This method truncates this string to given length.
|
||||
*
|
||||
* @update gess 01/04/99
|
||||
* @update rickg 03.23.2000
|
||||
* @param anIndex -- new length of string
|
||||
* @return nada
|
||||
*/
|
||||
@@ -192,10 +192,12 @@ void nsCString::SetLength(PRUint32 anIndex) {
|
||||
* @param aLength -- contains new length for mStr
|
||||
*/
|
||||
void nsCString::SetCapacity(PRUint32 aLength) {
|
||||
if(aLength>mCapacity) {
|
||||
GrowCapacity(*this,aLength);
|
||||
if(aLength) {
|
||||
if(aLength>mCapacity) {
|
||||
GrowCapacity(*this,aLength);
|
||||
}
|
||||
AddNullTerminator(*this);
|
||||
}
|
||||
AddNullTerminator(*this);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user