diff --git a/htmlparser/src/nsHTMLContentSinkStream.cpp b/htmlparser/src/nsHTMLContentSinkStream.cpp index 56cda843a60..1a7a977afa0 100644 --- a/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -360,7 +360,7 @@ nsHTMLContentSinkStream::InitEncoder() res = mUnicodeEncoder->Init(charsetCString, nsISaveAsCharset::attr_EntityBeforeCharsetConv | nsISaveAsCharset::attr_FallbackDecimalNCR, - nsIEntityConverter::html40); + nsIEntityConverter::html40); return res; } @@ -380,9 +380,6 @@ nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc) if (!mUnicodeEncoder) InitEncoder(); -// if (mBuffer) -// nsAllocator::Free(mBuffer); - if (mUnicodeEncoder) { // Call the converter to convert to the target charset. @@ -404,10 +401,11 @@ nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc) encodedBuffer = aSrc.ToNewCString(); } mBufferLength = 0; - if (encodedBuffer) { - mBufferLength = nsCRT::strlen(encodedBuffer); - EnsureBufferSize(mBufferLength+1); - nsCRT::memcpy(mBuffer, encodedBuffer, mBufferLength+1); + if (encodedBuffer) + { + mBufferLength = nsCRT::strlen(encodedBuffer); + EnsureBufferSize(mBufferLength+1); + nsCRT::memcpy(mBuffer, encodedBuffer, mBufferLength+1); } } diff --git a/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index 56cda843a60..1a7a977afa0 100644 --- a/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -360,7 +360,7 @@ nsHTMLContentSinkStream::InitEncoder() res = mUnicodeEncoder->Init(charsetCString, nsISaveAsCharset::attr_EntityBeforeCharsetConv | nsISaveAsCharset::attr_FallbackDecimalNCR, - nsIEntityConverter::html40); + nsIEntityConverter::html40); return res; } @@ -380,9 +380,6 @@ nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc) if (!mUnicodeEncoder) InitEncoder(); -// if (mBuffer) -// nsAllocator::Free(mBuffer); - if (mUnicodeEncoder) { // Call the converter to convert to the target charset. @@ -404,10 +401,11 @@ nsHTMLContentSinkStream::EncodeToBuffer(const nsString& aSrc) encodedBuffer = aSrc.ToNewCString(); } mBufferLength = 0; - if (encodedBuffer) { - mBufferLength = nsCRT::strlen(encodedBuffer); - EnsureBufferSize(mBufferLength+1); - nsCRT::memcpy(mBuffer, encodedBuffer, mBufferLength+1); + if (encodedBuffer) + { + mBufferLength = nsCRT::strlen(encodedBuffer); + EnsureBufferSize(mBufferLength+1); + nsCRT::memcpy(mBuffer, encodedBuffer, mBufferLength+1); } }