diff --git a/mozilla/base/src/nsString.cpp b/mozilla/base/src/nsString.cpp index 1b2882d99e0..99a54b766ca 100644 --- a/mozilla/base/src/nsString.cpp +++ b/mozilla/base/src/nsString.cpp @@ -165,7 +165,7 @@ void nsString::EnsureCapacityFor(PRInt32 aNewLength) mCapacity=newCapacity; chartype* temp = new chartype[newCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if(mStr && (mStr!=kCommonEmptyBuffer)) delete [] mStr; @@ -1795,7 +1795,7 @@ void nsAutoString::EnsureCapacityFor(PRInt32 aNewLength) { mCapacity=size; chartype* temp = new chartype[mCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if ((mStr != mBuf) && (0 != mStr)) { delete [] mStr; diff --git a/mozilla/base/src/nsString.h b/mozilla/base/src/nsString.h index d5b82c8fa7d..912f5fb9f35 100644 --- a/mozilla/base/src/nsString.h +++ b/mozilla/base/src/nsString.h @@ -234,7 +234,7 @@ public: protected: virtual void EnsureCapacityFor(PRInt32 aNewLength); - PRUnichar mBuf[32]; + chartype mBuf[32]; }; ostream& operator<<(ostream& os,nsAutoString& aString); diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 1b2882d99e0..99a54b766ca 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -165,7 +165,7 @@ void nsString::EnsureCapacityFor(PRInt32 aNewLength) mCapacity=newCapacity; chartype* temp = new chartype[newCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if(mStr && (mStr!=kCommonEmptyBuffer)) delete [] mStr; @@ -1795,7 +1795,7 @@ void nsAutoString::EnsureCapacityFor(PRInt32 aNewLength) { mCapacity=size; chartype* temp = new chartype[mCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if ((mStr != mBuf) && (0 != mStr)) { delete [] mStr; diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h index d5b82c8fa7d..912f5fb9f35 100644 --- a/mozilla/string/obsolete/nsString.h +++ b/mozilla/string/obsolete/nsString.h @@ -234,7 +234,7 @@ public: protected: virtual void EnsureCapacityFor(PRInt32 aNewLength); - PRUnichar mBuf[32]; + chartype mBuf[32]; }; ostream& operator<<(ostream& os,nsAutoString& aString); diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index 1b2882d99e0..99a54b766ca 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -165,7 +165,7 @@ void nsString::EnsureCapacityFor(PRInt32 aNewLength) mCapacity=newCapacity; chartype* temp = new chartype[newCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if(mStr && (mStr!=kCommonEmptyBuffer)) delete [] mStr; @@ -1795,7 +1795,7 @@ void nsAutoString::EnsureCapacityFor(PRInt32 aNewLength) { mCapacity=size; chartype* temp = new chartype[mCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if ((mStr != mBuf) && (0 != mStr)) { delete [] mStr; diff --git a/mozilla/xpcom/ds/nsString.h b/mozilla/xpcom/ds/nsString.h index d5b82c8fa7d..912f5fb9f35 100644 --- a/mozilla/xpcom/ds/nsString.h +++ b/mozilla/xpcom/ds/nsString.h @@ -234,7 +234,7 @@ public: protected: virtual void EnsureCapacityFor(PRInt32 aNewLength); - PRUnichar mBuf[32]; + chartype mBuf[32]; }; ostream& operator<<(ostream& os,nsAutoString& aString); diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index 1b2882d99e0..99a54b766ca 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -165,7 +165,7 @@ void nsString::EnsureCapacityFor(PRInt32 aNewLength) mCapacity=newCapacity; chartype* temp = new chartype[newCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if(mStr && (mStr!=kCommonEmptyBuffer)) delete [] mStr; @@ -1795,7 +1795,7 @@ void nsAutoString::EnsureCapacityFor(PRInt32 aNewLength) { mCapacity=size; chartype* temp = new chartype[mCapacity+1]; if (mLength > 0) { - nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype)); + nsCRT::memcpy(temp, mStr, mLength * sizeof(chartype) + sizeof(chartype)); } if ((mStr != mBuf) && (0 != mStr)) { delete [] mStr; diff --git a/mozilla/xpcom/string/obsolete/nsString.h b/mozilla/xpcom/string/obsolete/nsString.h index d5b82c8fa7d..912f5fb9f35 100644 --- a/mozilla/xpcom/string/obsolete/nsString.h +++ b/mozilla/xpcom/string/obsolete/nsString.h @@ -234,7 +234,7 @@ public: protected: virtual void EnsureCapacityFor(PRInt32 aNewLength); - PRUnichar mBuf[32]; + chartype mBuf[32]; }; ostream& operator<<(ostream& os,nsAutoString& aString);