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:
rickg%netscape.com
2000-03-24 07:21:56 +00:00
parent 39a364f3bd
commit 61451beb94
12 changed files with 78 additions and 66 deletions

View File

@@ -204,10 +204,12 @@ void nsString::SetLength(PRUint32 anIndex) {
* @return
*/
void nsString::SetCapacity(PRUint32 aLength) {
if(aLength>mCapacity) {
GrowCapacity(*this,aLength);
if(aLength) {
if(aLength>mCapacity) {
GrowCapacity(*this,aLength);
}
AddNullTerminator(*this);
}
AddNullTerminator(*this);
}
/**********************************************************************