From: Glenn L McGrath Date: Thu, 19 Dec 2002 20:16:22 +0000 (-0000) Subject: Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois X-Git-Tag: 1_00_pre1~272 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0f18271a8a565f003790a2cf6a8426308e0d229c;p=oweals%2Fbusybox.git Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois --- 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; }