Made nsString::Insert actually support the count=-1 default argument

git-svn-id: svn://10.0.0.236/trunk@14950 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com 1998-11-19 17:58:30 +00:00
parent 7380c40198
commit 84410733de
4 changed files with 4 additions and 0 deletions

View File

@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
*/
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
if (aCount < 0) aCount = aCopy.mLength;
if(0<=anOffset) {
if(aCount>0) {

View File

@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
*/
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
if (aCount < 0) aCount = aCopy.mLength;
if(0<=anOffset) {
if(aCount>0) {

View File

@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
*/
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
if (aCount < 0) aCount = aCopy.mLength;
if(0<=anOffset) {
if(aCount>0) {

View File

@ -939,6 +939,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
*/
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
if (aCount < 0) aCount = aCopy.mLength;
if(0<=anOffset) {
if(aCount>0) {