summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);