aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-15 19:38:50 +0000
committerRichard M. Stallman1994-05-15 19:38:50 +0000
commit3d4ad6e0a35eab9dbf0b1725542b57f2b03c0c78 (patch)
tree4fe747ca8acc35433f1d43c097686160e761980b /src
parent5fd4de15976b66a71ed8d8ea987f5292f77dbfb1 (diff)
downloademacs-3d4ad6e0a35eab9dbf0b1725542b57f2b03c0c78.tar.gz
emacs-3d4ad6e0a35eab9dbf0b1725542b57f2b03c0c78.zip
(crlf_to_lf): Fix off-by-one condition.
Diffstat (limited to 'src')
-rw-r--r--src/msdos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/msdos.c b/src/msdos.c
index ad7d8b4e478..eb95a800767 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -471,7 +471,7 @@ crlf_to_lf (n, buf)
471 471
472 if (n == 0) 472 if (n == 0)
473 return n; 473 return n;
474 while (buf < endp) 474 while (buf < endp - 1)
475 { 475 {
476 if (*buf == 0x0d) 476 if (*buf == 0x0d)
477 { 477 {
@@ -481,6 +481,8 @@ crlf_to_lf (n, buf)
481 else 481 else
482 *np++ = *buf++; 482 *np++ = *buf++;
483 } 483 }
484 if (buf < endp)
485 *np++ = *buf++;
484 return np - startp; 486 return np - startp;
485} 487}
486 488