bzip2recover.c (90067) | bzip2recover.c (146293) |
---|---|
1 2/*-----------------------------------------------------------*/ 3/*--- Block recoverer program for bzip2 ---*/ 4/*--- bzip2recover.c ---*/ 5/*-----------------------------------------------------------*/ 6 7/*-- 8 This program is bzip2recover, a program to attempt data 9 salvage from damaged files created by the accompanying | 1 2/*-----------------------------------------------------------*/ 3/*--- Block recoverer program for bzip2 ---*/ 4/*--- bzip2recover.c ---*/ 5/*-----------------------------------------------------------*/ 6 7/*-- 8 This program is bzip2recover, a program to attempt data 9 salvage from damaged files created by the accompanying |
10 bzip2-1.0 program. | 10 bzip2-1.0.3 program. |
11 | 11 |
12 Copyright (C) 1996-2002 Julian R Seward. All rights reserved. | 12 Copyright (C) 1996-2005 Julian R Seward. All rights reserved. |
13 14 Redistribution and use in source and binary forms, with or without 15 modification, are permitted provided that the following conditions 16 are met: 17 18 1. Redistributions of source code must retain the above copyright 19 notice, this list of conditions and the following disclaimer. 20 --- 17 unchanged lines hidden (view full) --- 38 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 39 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 40 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 41 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 42 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 45 Julian Seward, Cambridge, UK. | 13 14 Redistribution and use in source and binary forms, with or without 15 modification, are permitted provided that the following conditions 16 are met: 17 18 1. Redistributions of source code must retain the above copyright 19 notice, this list of conditions and the following disclaimer. 20 --- 17 unchanged lines hidden (view full) --- 38 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 39 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 40 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 41 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 42 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 45 Julian Seward, Cambridge, UK. |
46 jseward@acm.org 47 bzip2/libbzip2 version 1.0 of 21 March 2000 | 46 jseward@bzip.org 47 bzip2/libbzip2 version 1.0.3 of 15 February 2005 |
48--*/ 49 50/*-- 51 This program is a complete hack and should be rewritten 52 properly. It isn't very complicated. 53--*/ 54 55#include <stdio.h> --- 284 unchanged lines hidden (view full) --- 340 341 UInt32 buffHi, buffLo, blockCRC; 342 Char* p; 343 344 strcpy ( progName, argv[0] ); 345 inFileName[0] = outFileName[0] = 0; 346 347 fprintf ( stderr, | 48--*/ 49 50/*-- 51 This program is a complete hack and should be rewritten 52 properly. It isn't very complicated. 53--*/ 54 55#include <stdio.h> --- 284 unchanged lines hidden (view full) --- 340 341 UInt32 buffHi, buffLo, blockCRC; 342 Char* p; 343 344 strcpy ( progName, argv[0] ); 345 inFileName[0] = outFileName[0] = 0; 346 347 fprintf ( stderr, |
348 "bzip2recover 1.0.2: extracts blocks from damaged .bz2 files.\n" ); | 348 "bzip2recover 1.0.3: extracts blocks from damaged .bz2 files.\n" ); |
349 350 if (argc != 2) { 351 fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", 352 progName, progName ); 353 switch (sizeof(MaybeUInt64)) { 354 case 8: 355 fprintf(stderr, 356 "\trestrictions on size of recovered file: None\n"); --- 12 unchanged lines hidden (view full) --- 369 break; 370 } 371 exit(1); 372 } 373 374 if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) { 375 fprintf ( stderr, 376 "%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n", | 349 350 if (argc != 2) { 351 fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", 352 progName, progName ); 353 switch (sizeof(MaybeUInt64)) { 354 case 8: 355 fprintf(stderr, 356 "\trestrictions on size of recovered file: None\n"); --- 12 unchanged lines hidden (view full) --- 369 break; 370 } 371 exit(1); 372 } 373 374 if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) { 375 fprintf ( stderr, 376 "%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n", |
377 progName, strlen(argv[1]) ); | 377 progName, (int)strlen(argv[1]) ); |
378 exit(1); 379 } 380 381 strcpy ( inFileName, argv[1] ); 382 383 inFile = fopen ( inFileName, "rb" ); 384 if (inFile == NULL) { 385 fprintf ( stderr, "%s: can't read `%s'\n", progName, inFileName ); --- 161 unchanged lines hidden --- | 378 exit(1); 379 } 380 381 strcpy ( inFileName, argv[1] ); 382 383 inFile = fopen ( inFileName, "rb" ); 384 if (inFile == NULL) { 385 fprintf ( stderr, "%s: can't read `%s'\n", progName, inFileName ); --- 161 unchanged lines hidden --- |