--- pgp/src/zunzip.c 2018/04/24 16:41:04 1.1.1.4 +++ pgp/src/zunzip.c 2018/04/24 16:45:31 1.1.1.7 @@ -7,6 +7,7 @@ ---------------------------------------------------------------------------*/ #include "zunzip.h" /* includes, defines, and macros */ +#include "language.h" /* for LANG() */ #define VERSION "v4.20p BETA of 2-18-92" @@ -16,7 +17,8 @@ #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[] = @@ -34,7 +36,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; @@ -64,21 +67,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; @@ -94,7 +101,7 @@ int unzip( FILE *inFile, FILE *outFile ) lseek( zipfd, ftell(inFile), SEEK_SET ); if ((incnt = read(zipfd, (char *) inbuf,INBUFSIZ)) <= 0) { - fprintf(stderr, "error: unexpected end if input"); + fprintf(stderr, LANG("\nERROR: unexpected end of compressed data input.\n")); status = -1; /* can still do next file */ } inptr = inbuf;