From 0f18271a8a565f003790a2cf6a8426308e0d229c Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Thu, 19 Dec 2002 20:16:22 +0000 Subject: [PATCH] Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois --- networking/tftp.c | 9 +++++---- 1 file 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; }