--- pgp/src/zunzip.c 2018/04/24 16:39:22 1.1.1.3 +++ pgp/src/zunzip.c 2018/04/24 16:43:40 1.1.1.6 @@ -14,8 +14,11 @@ /* Global Variables */ /**********************/ +#if 0 longint csize; /* used by list_files(), ReadByte(): must be signed */ -static longint ucsize; /* used by list_files(), unReduce(), unImplode() */ +static longint ucsize; /* used by list_files(), unReduce(), + unImplode() */ +#endif ULONG mask_bits[] = {0x00000000L, @@ -32,7 +35,8 @@ ULONG mask_bits[] = Input file variables: ---------------------------------------------------------------------------*/ -byte *inbuf = NULL, *inptr; /* input buffer (any size is legal) and pointer */ +byte *inbuf = NULL, *inptr; /* input buffer (any size is legal) + and pointer */ int incnt; ULONG bitbuf; @@ -62,21 +66,25 @@ static byte *hold; /* Main unzip code */ /*******************/ -int unzip( FILE *inFile, FILE *outFile ) /* return PK-type error code (except under VMS) */ +int unzip( FILE *inFile, FILE *outFile ) /* return PK-type error code + (except under VMS) */ { int status = 0; outfd = fileno( outFile ); zipfd = fileno( inFile ); - inbuf = (byte *) (malloc(INBUFSIZ + 4)); /* 4 extra for hold[] (below) */ - outbuf = (byte *) (malloc(OUTBUFSIZ + 1)); /* 1 extra for string termin. */ + inbuf = (byte *) (malloc(INBUFSIZ + 4)); /* 4 extra for hold[] + (below) */ + outbuf = (byte *) (malloc(OUTBUFSIZ + 1)); /* 1 extra for string + termination */ outout = outbuf; /* else just point to outbuf */ if ((inbuf == NULL) || (outbuf == NULL) || (outout == NULL)) { fprintf(stderr, "error: can't allocate unzip buffers\n"); RETURN(4); /* 4-8: insufficient memory */ } - hold = &inbuf[INBUFSIZ]; /* to check for boundary-spanning signatures */ + hold = &inbuf[INBUFSIZ]; /* to check for boundary-spanning + signatures */ bits_left = 0; bitbuf = 0; @@ -97,13 +105,15 @@ int unzip( FILE *inFile, FILE *outFile ) } inptr = inbuf; +#if 0 /* Read in implode information */ csize = 1000L; /* Dummy size just to get input bits */ /* Get compressed, uncompressed file sizes */ csize = ucsize = 1000000000L; /* Make sure we can read in anything */ +#endif if (status == 0) - inflate(); /* Ftoomschk! */ + status = inflate(); /* Ftoomschk! */ /* Flush output buffer before returning */ if (status == 0 && FlushOutput())