From afbb008cab91f051a51505f2259add467434b1e3 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sat, 19 Feb 2000 09:17:49 +0000 Subject: [PATCH] changed 'embedded nulls' asserts to warnings in nsString git-svn-id: svn://10.0.0.236/trunk@61360 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsString.cpp | 10 +++++++--- mozilla/string/obsolete/nsString2.cpp | 17 +++++++++++++---- mozilla/xpcom/ds/nsString.cpp | 10 +++++++--- mozilla/xpcom/ds/nsString2.cpp | 17 +++++++++++++---- mozilla/xpcom/string/obsolete/nsString.cpp | 10 +++++++--- mozilla/xpcom/string/obsolete/nsString2.cpp | 17 +++++++++++++---- 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 38b4aa4fa36..52b0aca892e 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -35,12 +35,12 @@ #include "nsISizeOfHandler.h" #endif +static const char* kPossibleNull = "Error: possible unintended null in string"; static const char* kNullPointerError = "Error: unexpected null ptr"; static const char* kWhitespace="\b\t\r\n "; - static void CSubsume(nsStr& aDest,nsStr& aSource){ if(aSource.mStr && aSource.mLength) { if(aSource.mOwnsBuffer){ @@ -837,7 +837,9 @@ nsCString& nsCString::Assign(const PRUnichar* aString,PRInt32 aCount) { // the passed-in string. File a bug on the caller. #ifdef NS_DEBUG PRInt32 len=nsStr::FindChar(temp,0,PR_FALSE,0,temp.mLength); - NS_WARN_IF_FALSE(kNotFound==len,"possible embedded null in Assign(PRUnichar*)"); + if(kNotFound