changeset 301:0386663f9b1f

2003-10-27 Brian Masney <masneyb@gftp.org> * lib/rfc959.c (gftp_get_next_file_chunk) - fixed ASCII file corruption bug.
author masneyb
date Mon, 27 Oct 2003 23:21:51 +0000
parents 234944770ebd
children 14c0f5c3893c
files ChangeLog lib/rfc959.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 27 23:06:32 2003 +0000
+++ b/ChangeLog	Mon Oct 27 23:21:51 2003 +0000
@@ -1,4 +1,7 @@
 2003-10-27 Brian Masney <masneyb@gftp.org>
+	* lib/rfc959.c (gftp_get_next_file_chunk) - fixed ASCII file corruption
+	bug.
+
 	* TODO - the top of this file now contains a list of items that needs
 	to be completed before 2.0.16 can be released. If I missed something
 	important, please drop me an email.
@@ -1642,7 +1645,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.162 2003/10/27 23:06:32 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.163 2003/10/27 23:21:50 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/rfc959.c	Mon Oct 27 23:06:32 2003 +0000
+++ b/lib/rfc959.c	Mon Oct 27 23:21:51 2003 +0000
@@ -1338,8 +1338,8 @@
 static ssize_t
 rfc959_get_next_file_chunk (gftp_request * request, char *buf, size_t size)
 {
+  ssize_t num_read, ret;
   rfc959_parms * parms;
-  ssize_t num_read;
   int i, j;
 
   parms = request->protocol_data;
@@ -1348,6 +1348,7 @@
   if (num_read < 0)
     return (num_read);
 
+  ret = num_read;
   if (parms->is_ascii_transfer)
     {
       for (i = 0, j = 0; i < num_read; i++)
@@ -1355,11 +1356,11 @@
           if (buf[i] != '\r')
             buf[j++] = buf[i];
           else
-            num_read--;
+            ret--;
         }
     }
 
-  return (num_read);
+  return (ret);
 }