diff options
Diffstat (limited to 'gunzip.c')
-rw-r--r-- | gunzip.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -194,7 +194,7 @@ extern int method; /* compression method */ | |||
194 | # define DECLARE(type, array, size) type * array | 194 | # define DECLARE(type, array, size) type * array |
195 | # define ALLOC(type, array, size) { \ | 195 | # define ALLOC(type, array, size) { \ |
196 | array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ | 196 | array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ |
197 | if (array == NULL) error("insufficient memory"); \ | 197 | if (array == NULL) errorMsg("insufficient memory"); \ |
198 | } | 198 | } |
199 | # define FREE(array) {if (array != NULL) free(array), array=NULL;} | 199 | # define FREE(array) {if (array != NULL) free(array), array=NULL;} |
200 | #else | 200 | #else |
@@ -311,7 +311,7 @@ extern int save_orig_name; /* set if original name must be saved */ | |||
311 | 311 | ||
312 | /* Diagnostic functions */ | 312 | /* Diagnostic functions */ |
313 | #ifdef DEBUG | 313 | #ifdef DEBUG |
314 | # define Assert(cond,msg) {if(!(cond)) error(msg);} | 314 | # define Assert(cond,msg) {if(!(cond)) errorMsg(msg);} |
315 | # define Trace(x) fprintf x | 315 | # define Trace(x) fprintf x |
316 | # define Tracev(x) {if (verbose) fprintf x ;} | 316 | # define Tracev(x) {if (verbose) fprintf x ;} |
317 | # define Tracevv(x) {if (verbose>1) fprintf x ;} | 317 | # define Tracevv(x) {if (verbose>1) fprintf x ;} |
@@ -367,8 +367,6 @@ extern void write_buf OF((int fd, voidp buf, unsigned cnt)); | |||
367 | #ifndef __linux__ | 367 | #ifndef __linux__ |
368 | extern char *basename OF((char *fname)); | 368 | extern char *basename OF((char *fname)); |
369 | #endif /* not __linux__ */ | 369 | #endif /* not __linux__ */ |
370 | extern void error OF((char *m)); | ||
371 | extern void warn OF((char *a, char *b)); | ||
372 | extern void read_error OF((void)); | 370 | extern void read_error OF((void)); |
373 | extern void write_error OF((void)); | 371 | extern void write_error OF((void)); |
374 | 372 | ||
@@ -1045,13 +1043,13 @@ int in, out; /* input and output file descriptors */ | |||
1045 | int res = inflate(); | 1043 | int res = inflate(); |
1046 | 1044 | ||
1047 | if (res == 3) { | 1045 | if (res == 3) { |
1048 | error("out of memory"); | 1046 | errorMsg("out of memory"); |
1049 | } else if (res != 0) { | 1047 | } else if (res != 0) { |
1050 | error("invalid compressed data--format violated"); | 1048 | errorMsg("invalid compressed data--format violated"); |
1051 | } | 1049 | } |
1052 | 1050 | ||
1053 | } else { | 1051 | } else { |
1054 | error("internal error, invalid method"); | 1052 | errorMsg("internal error, invalid method"); |
1055 | } | 1053 | } |
1056 | 1054 | ||
1057 | /* Get the crc and original length */ | 1055 | /* Get the crc and original length */ |
@@ -1080,10 +1078,10 @@ int in, out; /* input and output file descriptors */ | |||
1080 | 1078 | ||
1081 | /* Validate decompression */ | 1079 | /* Validate decompression */ |
1082 | if (orig_crc != updcrc(outbuf, 0)) { | 1080 | if (orig_crc != updcrc(outbuf, 0)) { |
1083 | error("invalid compressed data--crc error"); | 1081 | errorMsg("invalid compressed data--crc error"); |
1084 | } | 1082 | } |
1085 | if (orig_len != (ulg) bytes_out) { | 1083 | if (orig_len != (ulg) bytes_out) { |
1086 | error("invalid compressed data--length error"); | 1084 | errorMsg("invalid compressed data--length error"); |
1087 | } | 1085 | } |
1088 | 1086 | ||
1089 | /* Check if there are more entries in a pkzip file */ | 1087 | /* Check if there are more entries in a pkzip file */ |