diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-19 20:16:22 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-12-19 20:16:22 +0000 |
commit | 0f18271a8a565f003790a2cf6a8426308e0d229c (patch) | |
tree | 443dfa36024edd0887135a4a9dadbceb43fd2d15 | |
parent | 1643f419868dc245f88f35a1fda8b7ac8b66b6b6 (diff) | |
download | busybox-0f18271a8a565f003790a2cf6a8426308e0d229c.tar.gz |
Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois
-rw-r--r-- | networking/tftp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index a3808f5bf..378ba2fef 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -279,8 +279,6 @@ static inline int tftp(const int cmd, const struct hostent *host, } cp += len; - } else if (finished) { - break; } } @@ -306,8 +304,11 @@ static inline int tftp(const int cmd, const struct hostent *host, } - /* receive packet */ + if (finished) { + break; + } + /* receive packet */ memset(&from, 0, sizeof(from)); fromlen = sizeof(from); @@ -359,7 +360,7 @@ static inline int tftp(const int cmd, const struct hostent *host, } while (timeout && (len >= 0)); - if (len < 0) { + if ((finished) || (len < 0)) { break; } |