changeset 7507:b393834bab2a

(crlf_to_lf): Fix off-by-one condition.
author Richard M. Stallman <rms@gnu.org>
date Sun, 15 May 1994 19:38:50 +0000
parents 9fa47d36798a
children a15923bc982d
files src/msdos.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/msdos.c	Sun May 15 19:25:21 1994 +0000
+++ b/src/msdos.c	Sun May 15 19:38:50 1994 +0000
@@ -471,7 +471,7 @@
 
   if (n == 0)
     return n;
-  while (buf < endp)
+  while (buf < endp - 1)
     {
       if (*buf == 0x0d)
 	{
@@ -481,6 +481,8 @@
       else
 	*np++ = *buf++;
     }
+  if (buf < endp)
+    *np++ = *buf++;
   return np - startp;
 }