mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
[XPCOM] Improve the conversion of line breaks.
Fix an off-by-one error in CRLF checking.
This commit is contained in:
parent
f2cd5760ba
commit
b188579bb6
1 changed files with 2 additions and 2 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue