From 5eea057c07a001fefd86e0d3ca49b1abc99d883c Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sun, 25 Apr 1999 01:51:21 +0000 Subject: [PATCH] fix to nsString2 constructor --- base/src/nsString2.cpp | 3 ++- string/obsolete/nsString2.cpp | 3 ++- xpcom/ds/nsString2.cpp | 3 ++- xpcom/string/obsolete/nsString2.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/base/src/nsString2.cpp b/base/src/nsString2.cpp index c661c7b27ef..44922f0d55a 100644 --- a/base/src/nsString2.cpp +++ b/base/src/nsString2.cpp @@ -2038,7 +2038,8 @@ nsAutoString2::nsAutoString2(eCharSize aCharSize) : nsString2(aCharSize){ * @param aCString is a ptr to a 1-byte cstr */ nsAutoString2::nsAutoString2(nsStr& aStr,const char* aCString) : nsString2((eCharSize)aStr.mMultibyte) { - nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>aStr.mMultibyte)-1,0,aStr.mMultibyte,PR_FALSE); + eCharSize theSize=(eCharSize)aStr.mMultibyte; + nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>theCharSize)-1,0,theCharSize,PR_FALSE); mAgent=0; AddNullTerminator(*this); Assign(aCString); diff --git a/string/obsolete/nsString2.cpp b/string/obsolete/nsString2.cpp index c661c7b27ef..44922f0d55a 100644 --- a/string/obsolete/nsString2.cpp +++ b/string/obsolete/nsString2.cpp @@ -2038,7 +2038,8 @@ nsAutoString2::nsAutoString2(eCharSize aCharSize) : nsString2(aCharSize){ * @param aCString is a ptr to a 1-byte cstr */ nsAutoString2::nsAutoString2(nsStr& aStr,const char* aCString) : nsString2((eCharSize)aStr.mMultibyte) { - nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>aStr.mMultibyte)-1,0,aStr.mMultibyte,PR_FALSE); + eCharSize theSize=(eCharSize)aStr.mMultibyte; + nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>theCharSize)-1,0,theCharSize,PR_FALSE); mAgent=0; AddNullTerminator(*this); Assign(aCString); diff --git a/xpcom/ds/nsString2.cpp b/xpcom/ds/nsString2.cpp index c661c7b27ef..44922f0d55a 100644 --- a/xpcom/ds/nsString2.cpp +++ b/xpcom/ds/nsString2.cpp @@ -2038,7 +2038,8 @@ nsAutoString2::nsAutoString2(eCharSize aCharSize) : nsString2(aCharSize){ * @param aCString is a ptr to a 1-byte cstr */ nsAutoString2::nsAutoString2(nsStr& aStr,const char* aCString) : nsString2((eCharSize)aStr.mMultibyte) { - nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>aStr.mMultibyte)-1,0,aStr.mMultibyte,PR_FALSE); + eCharSize theSize=(eCharSize)aStr.mMultibyte; + nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>theCharSize)-1,0,theCharSize,PR_FALSE); mAgent=0; AddNullTerminator(*this); Assign(aCString); diff --git a/xpcom/string/obsolete/nsString2.cpp b/xpcom/string/obsolete/nsString2.cpp index c661c7b27ef..44922f0d55a 100644 --- a/xpcom/string/obsolete/nsString2.cpp +++ b/xpcom/string/obsolete/nsString2.cpp @@ -2038,7 +2038,8 @@ nsAutoString2::nsAutoString2(eCharSize aCharSize) : nsString2(aCharSize){ * @param aCString is a ptr to a 1-byte cstr */ nsAutoString2::nsAutoString2(nsStr& aStr,const char* aCString) : nsString2((eCharSize)aStr.mMultibyte) { - nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>aStr.mMultibyte)-1,0,aStr.mMultibyte,PR_FALSE); + eCharSize theSize=(eCharSize)aStr.mMultibyte; + nsStr::Initialize(*this,mBuffer,(sizeof(mBuffer)>>theCharSize)-1,0,theCharSize,PR_FALSE); mAgent=0; AddNullTerminator(*this); Assign(aCString);