Commit 3d4ad6e0 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(crlf_to_lf): Fix off-by-one condition.

parent 5fd4de15
......@@ -471,7 +471,7 @@ crlf_to_lf (n, buf)
if (n == 0)
return n;
while (buf < endp)
while (buf < endp - 1)
{
if (*buf == 0x0d)
{
......@@ -481,6 +481,8 @@ crlf_to_lf (n, buf)
else
*np++ = *buf++;
}
if (buf < endp)
*np++ = *buf++;
return np - startp;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment