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 c48a61f..af59732 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 */