From 00192bb235e6acb2c10e9d552e390af9b9b9f294 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sun, 14 Nov 1999 10:05:40 +0000 Subject: [PATCH] change NS_ASSERTION to NS_WARN_IF_FALSE; r=none git-svn-id: svn://10.0.0.236/trunk@53459 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsString.cpp | 8 ++++---- mozilla/string/obsolete/nsString2.cpp | 9 +++++---- mozilla/xpcom/ds/nsString.cpp | 8 ++++---- mozilla/xpcom/ds/nsString2.cpp | 9 +++++---- mozilla/xpcom/string/obsolete/nsString.cpp | 8 ++++---- mozilla/xpcom/string/obsolete/nsString2.cpp | 9 +++++---- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index cef4a597837..4f54c31288f 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -796,7 +796,7 @@ nsCString& nsCString::Assign(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Assign(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Assign(PRUnichar*)"); #endif } @@ -901,11 +901,11 @@ nsCString& nsCString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif - } else aCount=temp.mLength=nsCRT::strlen(aCString); @@ -1091,7 +1091,7 @@ nsCString& nsCString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCou // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index 27321798c3b..edfd97e3d3a 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -1042,9 +1042,10 @@ nsString& nsString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif } @@ -1076,7 +1077,7 @@ nsString& nsString::Append(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in append(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(PRUnichar*)"); #endif } @@ -1266,7 +1267,7 @@ nsString& nsString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCount // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } @@ -1301,7 +1302,7 @@ nsString& nsString::Insert(const PRUnichar* aString,PRUint32 anOffset,PRInt32 aC // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Insert(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(PRUnichar*)"); #endif } diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index cef4a597837..4f54c31288f 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -796,7 +796,7 @@ nsCString& nsCString::Assign(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Assign(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Assign(PRUnichar*)"); #endif } @@ -901,11 +901,11 @@ nsCString& nsCString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif - } else aCount=temp.mLength=nsCRT::strlen(aCString); @@ -1091,7 +1091,7 @@ nsCString& nsCString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCou // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp index 27321798c3b..edfd97e3d3a 100644 --- a/mozilla/xpcom/ds/nsString2.cpp +++ b/mozilla/xpcom/ds/nsString2.cpp @@ -1042,9 +1042,10 @@ nsString& nsString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif } @@ -1076,7 +1077,7 @@ nsString& nsString::Append(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in append(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(PRUnichar*)"); #endif } @@ -1266,7 +1267,7 @@ nsString& nsString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCount // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } @@ -1301,7 +1302,7 @@ nsString& nsString::Insert(const PRUnichar* aString,PRUint32 anOffset,PRInt32 aC // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Insert(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(PRUnichar*)"); #endif } diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index cef4a597837..4f54c31288f 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -796,7 +796,7 @@ nsCString& nsCString::Assign(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Assign(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Assign(PRUnichar*)"); #endif } @@ -901,11 +901,11 @@ nsCString& nsCString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif - } else aCount=temp.mLength=nsCRT::strlen(aCString); @@ -1091,7 +1091,7 @@ nsCString& nsCString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCou // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index 27321798c3b..edfd97e3d3a 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -1042,9 +1042,10 @@ nsString& nsString::Append(const char* aCString,PRInt32 aCount) { // If this assertion fires, the caller is probably lying about the length of // the passed-in string. File a bug on the caller. + #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in append(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(char*)"); #endif } @@ -1076,7 +1077,7 @@ nsString& nsString::Append(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in append(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in append(PRUnichar*)"); #endif } @@ -1266,7 +1267,7 @@ nsString& nsString::Insert(const char* aCString,PRUint32 anOffset,PRInt32 aCount // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=strlen(aCString); - NS_ASSERTION(aCount <= len, "potential error in Insert(char*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(char*)"); #endif } @@ -1301,7 +1302,7 @@ nsString& nsString::Insert(const PRUnichar* aString,PRUint32 anOffset,PRInt32 aC // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsCRT::strlen(aString); - NS_ASSERTION(aCount <= len, "potential error in Insert(PRUnichar*)"); + NS_WARN_IF_FALSE(len>=aCount,"possible embedded null in Insert(PRUnichar*)"); #endif }