rx: fix file corruption on block checksum failure
authorDaniel Fandrich <dan@coneharvesters.com>
Wed, 23 Nov 2011 11:07:31 +0000 (12:07 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 23 Nov 2011 11:07:31 +0000 (12:07 +0100)
Rather than dropping the bad block, rx was appending it
to the file.

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/rx.c

index c48a61fd061d1ba9993bc06c951cc319ceb2e3b2..af597320cee6ad97a289f69adcc713249ecc9732 100644 (file)
@@ -207,6 +207,7 @@ static int receive(/*int read_fd, */int file_fd)
                continue;
  error:
  timeout:
+               blockLength = 0;
                errors++;
                if (errors == MAXERRORS) {
                        /* Abort */