diff --git a/mozilla/content/base/src/nsHTMLContentSerializer.cpp b/mozilla/content/base/src/nsHTMLContentSerializer.cpp
index a87f7594a92..49a0fa47faa 100644
--- a/mozilla/content/base/src/nsHTMLContentSerializer.cpp
+++ b/mozilla/content/base/src/nsHTMLContentSerializer.cpp
@@ -964,7 +964,6 @@ nsHTMLContentSerializer::AppendToString(const nsAString& aStr,
if (!entityReplacement.IsEmpty()) {
entityText = entityReplacement.get();
- lengthReplaced = 1;
break;
}
}
@@ -998,7 +997,7 @@ nsHTMLContentSerializer::AppendToString(const nsAString& aStr,
aOutputStr.Append(PRUnichar('&'));
AppendASCIItoUTF16(entityText, aOutputStr);
aOutputStr.Append(PRUnichar(';'));
- advanceLength += lengthReplaced;
+ advanceLength++;
}
// if it comes from nsIEntityConverter, it already has '&' and ';'
else if (fullEntityText) {