aboutsummaryrefslogtreecommitdiff
path: root/bzip2.c
diff options
context:
space:
mode:
authorJulian Seward <jseward@acm.org>2005-02-15 22:13:13 +0100
committerJulian Seward <jseward@acm.org>2005-02-15 22:13:13 +0100
commit4d540bfc95a4b0eefc1d1f388ec33534aaeb3a2f (patch)
tree3b7e9c650b4c61d114e1716c4698e40d5c8d7ef7 /bzip2.c
parent099d844292f60f9d58914da29e5773204dc55e7a (diff)
downloadbzip2-4d540bfc95a4b0eefc1d1f388ec33534aaeb3a2f.tar.gz
bzip2-4d540bfc95a4b0eefc1d1f388ec33534aaeb3a2f.tar.bz2
bzip2-4d540bfc95a4b0eefc1d1f388ec33534aaeb3a2f.zip
bzip2-1.0.3bzip2-1.0.3
Diffstat (limited to 'bzip2.c')
-rw-r--r--bzip2.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/bzip2.c b/bzip2.c
index 807f420..79f87a5 100644
--- a/bzip2.c
+++ b/bzip2.c
@@ -7,7 +7,7 @@
7 This file is a part of bzip2 and/or libbzip2, a program and 7 This file is a part of bzip2 and/or libbzip2, a program and
8 library for lossless, block-sorting data compression. 8 library for lossless, block-sorting data compression.
9 9
10 Copyright (C) 1996-2002 Julian R Seward. All rights reserved. 10 Copyright (C) 1996-2005 Julian R Seward. All rights reserved.
11 11
12 Redistribution and use in source and binary forms, with or without 12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions 13 modification, are permitted provided that the following conditions
@@ -41,7 +41,7 @@
41 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 42
43 Julian Seward, Cambridge, UK. 43 Julian Seward, Cambridge, UK.
44 jseward@acm.org 44 jseward@bzip.org
45 bzip2/libbzip2 version 1.0 of 21 March 2000 45 bzip2/libbzip2 version 1.0 of 21 March 2000
46 46
47 This program is based on (at least) the work of: 47 This program is based on (at least) the work of:
@@ -525,6 +525,7 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
525 UChar obuf[5000]; 525 UChar obuf[5000];
526 UChar unused[BZ_MAX_UNUSED]; 526 UChar unused[BZ_MAX_UNUSED];
527 Int32 nUnused; 527 Int32 nUnused;
528 void* unusedTmpV;
528 UChar* unusedTmp; 529 UChar* unusedTmp;
529 530
530 nUnused = 0; 531 nUnused = 0;
@@ -554,9 +555,10 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
554 } 555 }
555 if (bzerr != BZ_STREAM_END) goto errhandler; 556 if (bzerr != BZ_STREAM_END) goto errhandler;
556 557
557 BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused ); 558 BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
558 if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); 559 if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
559 560
561 unusedTmp = (UChar*)unusedTmpV;
560 for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; 562 for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
561 563
562 BZ2_bzReadClose ( &bzerr, bzf ); 564 BZ2_bzReadClose ( &bzerr, bzf );
@@ -639,6 +641,7 @@ Bool testStream ( FILE *zStream )
639 UChar obuf[5000]; 641 UChar obuf[5000];
640 UChar unused[BZ_MAX_UNUSED]; 642 UChar unused[BZ_MAX_UNUSED];
641 Int32 nUnused; 643 Int32 nUnused;
644 void* unusedTmpV;
642 UChar* unusedTmp; 645 UChar* unusedTmp;
643 646
644 nUnused = 0; 647 nUnused = 0;
@@ -662,9 +665,10 @@ Bool testStream ( FILE *zStream )
662 } 665 }
663 if (bzerr != BZ_STREAM_END) goto errhandler; 666 if (bzerr != BZ_STREAM_END) goto errhandler;
664 667
665 BZ2_bzReadGetUnused ( &bzerr, bzf, (void**)(&unusedTmp), &nUnused ); 668 BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
666 if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); 669 if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
667 670
671 unusedTmp = (UChar*)unusedTmpV;
668 for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; 672 for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
669 673
670 BZ2_bzReadClose ( &bzerr, bzf ); 674 BZ2_bzReadClose ( &bzerr, bzf );
@@ -828,7 +832,7 @@ void panic ( Char* s )
828 "\n%s: PANIC -- internal consistency error:\n" 832 "\n%s: PANIC -- internal consistency error:\n"
829 "\t%s\n" 833 "\t%s\n"
830 "\tThis is a BUG. Please report it to me at:\n" 834 "\tThis is a BUG. Please report it to me at:\n"
831 "\tjseward@acm.org\n", 835 "\tjseward@bzip.org\n",
832 progName, s ); 836 progName, s );
833 showFileNames(); 837 showFileNames();
834 cleanUpAndFail( 3 ); 838 cleanUpAndFail( 3 );
@@ -908,7 +912,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
908 " The user's manual, Section 4.3, has more info on (1) and (2).\n" 912 " The user's manual, Section 4.3, has more info on (1) and (2).\n"
909 " \n" 913 " \n"
910 " If you suspect this is a bug in bzip2, or are unsure about (1)\n" 914 " If you suspect this is a bug in bzip2, or are unsure about (1)\n"
911 " or (2), feel free to report it to me at: jseward@acm.org.\n" 915 " or (2), feel free to report it to me at: jseward@bzip.org.\n"
912 " Section 4.3 of the user's manual describes the info a useful\n" 916 " Section 4.3 of the user's manual describes the info a useful\n"
913 " bug report should have. If the manual is available on your\n" 917 " bug report should have. If the manual is available on your\n"
914 " system, please try and read it before mailing me. If you don't\n" 918 " system, please try and read it before mailing me. If you don't\n"
@@ -931,7 +935,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
931 " The user's manual, Section 4.3, has more info on (2) and (3).\n" 935 " The user's manual, Section 4.3, has more info on (2) and (3).\n"
932 " \n" 936 " \n"
933 " If you suspect this is a bug in bzip2, or are unsure about (2)\n" 937 " If you suspect this is a bug in bzip2, or are unsure about (2)\n"
934 " or (3), feel free to report it to me at: jseward@acm.org.\n" 938 " or (3), feel free to report it to me at: jseward@bzip.org.\n"
935 " Section 4.3 of the user's manual describes the info a useful\n" 939 " Section 4.3 of the user's manual describes the info a useful\n"
936 " bug report should have. If the manual is available on your\n" 940 " bug report should have. If the manual is available on your\n"
937 " system, please try and read it before mailing me. If you don't\n" 941 " system, please try and read it before mailing me. If you don't\n"
@@ -1674,7 +1678,7 @@ void license ( void )
1674 "bzip2, a block-sorting file compressor. " 1678 "bzip2, a block-sorting file compressor. "
1675 "Version %s.\n" 1679 "Version %s.\n"
1676 " \n" 1680 " \n"
1677 " Copyright (C) 1996-2002 by Julian Seward.\n" 1681 " Copyright (C) 1996-2005 by Julian Seward.\n"
1678 " \n" 1682 " \n"
1679 " This program is free software; you can redistribute it and/or modify\n" 1683 " This program is free software; you can redistribute it and/or modify\n"
1680 " it under the terms set out in the LICENSE file, which is included\n" 1684 " it under the terms set out in the LICENSE file, which is included\n"