From: Dan Fandrich Date: Thu, 3 Nov 2011 09:18:33 +0000 (+0100) Subject: rx: Fix file corruption with duplicate blocks X-Git-Tag: 1_20_0~163 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f808e777db05bed7b3c0a4aa5f12121fb3d0ca5f;p=oweals%2Fbusybox.git rx: Fix file corruption with duplicate blocks Rather than dropping the dupe, rx was appending it to the file. Signed-off-by: Dan Fandrich Signed-off-by: Denys Vlasenko --- diff --git a/miscutils/rx.c b/miscutils/rx.c index e1225779e..972f7ff37 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -172,6 +172,7 @@ static int receive(/*int read_fd, */int file_fd) /* a repeat of the last block is ok, just ignore it. */ /* this also ignores the initial block 0 which is */ /* meta data. */ + blockLength = 0; goto next; } if (blockNo != (wantBlockNo & 0xff)) {