aboutsummaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-12-19 20:16:22 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-12-19 20:16:22 +0000
commit0f18271a8a565f003790a2cf6a8426308e0d229c (patch)
tree443dfa36024edd0887135a4a9dadbceb43fd2d15 /networking/tftp.c
parent1643f419868dc245f88f35a1fda8b7ac8b66b6b6 (diff)
downloadbusybox-w32-0f18271a8a565f003790a2cf6a8426308e0d229c.tar.gz
busybox-w32-0f18271a8a565f003790a2cf6a8426308e0d229c.tar.bz2
busybox-w32-0f18271a8a565f003790a2cf6a8426308e0d229c.zip
Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c9
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,
279 } 279 }
280 280
281 cp += len; 281 cp += len;
282 } else if (finished) {
283 break;
284 } 282 }
285 } 283 }
286 284
@@ -306,8 +304,11 @@ static inline int tftp(const int cmd, const struct hostent *host,
306 } 304 }
307 305
308 306
309 /* receive packet */ 307 if (finished) {
308 break;
309 }
310 310
311 /* receive packet */
311 312
312 memset(&from, 0, sizeof(from)); 313 memset(&from, 0, sizeof(from));
313 fromlen = sizeof(from); 314 fromlen = sizeof(from);
@@ -359,7 +360,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
359 360
360 } while (timeout && (len >= 0)); 361 } while (timeout && (len >= 0));
361 362
362 if (len < 0) { 363 if ((finished) || (len < 0)) {
363 break; 364 break;
364 } 365 }
365 366