summaryrefslogtreecommitdiff
path: root/xpcom
diff options
context:
space:
mode:
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>2022-05-05 16:54:07 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-05-05 16:54:23 -0500
commit0a2ad0f460db70287ba15958a65f3d7785edfa23 (patch)
treef43652d27fbe20d5862dccfd12e664d92f465d59 /xpcom
parent2678e7f06f0e13e617046bd270f25b8358be5f15 (diff)
downloadaura-central-0a2ad0f460db70287ba15958a65f3d7785edfa23.tar.gz
Bug 1761481 - Improve the conversion of line breaks.
Diffstat (limited to 'xpcom')
-rw-r--r--xpcom/io/nsLinebreakConverter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xpcom/io/nsLinebreakConverter.cpp b/xpcom/io/nsLinebreakConverter.cpp
index d026faf38..590cb8540 100644
--- a/xpcom/io/nsLinebreakConverter.cpp
+++ b/xpcom/io/nsLinebreakConverter.cpp
@@ -217,7 +217,7 @@ ConvertUnknownBreaks(const T* aInSrc, int32_t& aIoLen, const char* aDestBreak)
while (src < srcEnd) {
if (*src == nsCRT::CR) {
- if (src < srcEnd && src[1] == nsCRT::LF) {
+ if (src + 1< srcEnd && src[1] == nsCRT::LF) {
// CRLF
finalLen += destBreakLen;
src++;
@@ -246,7 +246,7 @@ ConvertUnknownBreaks(const T* aInSrc, int32_t& aIoLen, const char* aDestBreak)
while (src < srcEnd) {
if (*src == nsCRT::CR) {
- if (src < srcEnd && src[1] == nsCRT::LF) {
+ if (src + 1 < srcEnd && src[1] == nsCRT::LF) {
// CRLF
AppendLinebreak(dst, aDestBreak);
src++;