Bug 1097283: Fix count/byte mismatches in NS_ABORT_OOM calls. r=froydnj

This commit is contained in:
David Major
2014-11-12 15:42:53 +13:00
parent 03668e7a4d
commit 3da2a00813
7 changed files with 39 additions and 26 deletions

View File

@@ -95,7 +95,7 @@ void
AppendASCIItoUTF16(const nsACString& aSource, nsAString& aDest)
{
if (!AppendASCIItoUTF16(aSource, aDest, mozilla::fallible_t())) {
NS_ABORT_OOM(aDest.Length() + aSource.Length());
aDest.AllocFailed(aDest.Length() + aSource.Length());
}
}
@@ -144,7 +144,7 @@ void
AppendUTF16toUTF8(const nsAString& aSource, nsACString& aDest)
{
if (!AppendUTF16toUTF8(aSource, aDest, mozilla::fallible_t())) {
NS_ABORT_OOM(aDest.Length() + aSource.Length());
aDest.AllocFailed(aDest.Length() + aSource.Length());
}
}
@@ -185,7 +185,7 @@ void
AppendUTF8toUTF16(const nsACString& aSource, nsAString& aDest)
{
if (!AppendUTF8toUTF16(aSource, aDest, mozilla::fallible_t())) {
NS_ABORT_OOM(aDest.Length() + aSource.Length());
aDest.AllocFailed(aDest.Length() + aSource.Length());
}
}