summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-16 23:00:44 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-16 23:00:44 +0000
commitcf286eca628e0c950c0e8739a9803db1aa9c35ef (patch)
tree041130814c9f903051db423f2c50581f9fdad2d2
parentdf34dff4a1e66427ba37198f6094a497992406aa (diff)
downloaddrakx-cf286eca628e0c950c0e8739a9803db1aa9c35ef.tar
drakx-cf286eca628e0c950c0e8739a9803db1aa9c35ef.tar.gz
drakx-cf286eca628e0c950c0e8739a9803db1aa9c35ef.tar.bz2
drakx-cf286eca628e0c950c0e8739a9803db1aa9c35ef.tar.xz
drakx-cf286eca628e0c950c0e8739a9803db1aa9c35ef.zip
fix buggy redhat code exhausted only in -Os which corrupted
memory and gave wrong results for download file size in FTP/HTTP installs
-rw-r--r--mdk-stage1/url.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdk-stage1/url.c b/mdk-stage1/url.c
index 47014fcb7..0c4dbbedf 100644
--- a/mdk-stage1/url.c
+++ b/mdk-stage1/url.c
@@ -337,7 +337,7 @@ static int ftp_get_filesize(int sock, char * remotename)
}
ptr = buf;
- while ((tot = read(fd, ptr, sizeof(buf) - (ptr - buf))) != 0)
+ while ((tot = read(fd, ptr, sizeof(buf) - (ptr - buf) - 1)) != 0)
ptr += tot;
*ptr = '\0';
close(fd);