aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/gunzip.c16
-rw-r--r--archival/gzip.c16
2 files changed, 14 insertions, 18 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 2bc490e3e..e1c8ac06e 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -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__
368extern char *basename OF((char *fname)); 368extern char *basename OF((char *fname));
369#endif /* not __linux__ */ 369#endif /* not __linux__ */
370extern void error OF((char *m));
371extern void warn OF((char *a, char *b));
372extern void read_error OF((void)); 370extern void read_error OF((void));
373extern void write_error OF((void)); 371extern 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 */
diff --git a/archival/gzip.c b/archival/gzip.c
index f132679f7..e275fa274 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -125,7 +125,7 @@ extern int method; /* compression method */
125# define DECLARE(type, array, size) type * near array 125# define DECLARE(type, array, size) type * near array
126# define ALLOC(type, array, size) { \ 126# define ALLOC(type, array, size) { \
127 array = (type*)fcalloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ 127 array = (type*)fcalloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \
128 if (array == NULL) error("insufficient memory"); \ 128 if (array == NULL) errorMsg("insufficient memory"); \
129 } 129 }
130# define FREE(array) {if (array != NULL) fcfree(array), array=NULL;} 130# define FREE(array) {if (array != NULL) fcfree(array), array=NULL;}
131#else 131#else
@@ -262,7 +262,7 @@ extern int save_orig_name; /* set if original name must be saved */
262 262
263/* Diagnostic functions */ 263/* Diagnostic functions */
264#ifdef DEBUG 264#ifdef DEBUG
265# define Assert(cond,msg) {if(!(cond)) error(msg);} 265# define Assert(cond,msg) {if(!(cond)) errorMsg(msg);}
266# define Trace(x) fprintf x 266# define Trace(x) fprintf x
267# define Tracev(x) {if (verbose) fprintf x ;} 267# define Tracev(x) {if (verbose) fprintf x ;}
268# define Tracevv(x) {if (verbose>1) fprintf x ;} 268# define Tracevv(x) {if (verbose>1) fprintf x ;}
@@ -327,8 +327,6 @@ extern void flush_window OF((void));
327extern void write_buf OF((int fd, voidp buf, unsigned cnt)); 327extern void write_buf OF((int fd, voidp buf, unsigned cnt));
328extern char *strlwr OF((char *s)); 328extern char *strlwr OF((char *s));
329extern char *add_envopt OF((int *argcp, char ***argvp, char *env)); 329extern char *add_envopt OF((int *argcp, char ***argvp, char *env));
330extern void error OF((char *m));
331extern void warn OF((char *a, char *b));
332extern void read_error OF((void)); 330extern void read_error OF((void));
333extern void write_error OF((void)); 331extern void write_error OF((void));
334extern void display_ratio OF((long num, long den, FILE * file)); 332extern void display_ratio OF((long num, long den, FILE * file));
@@ -1396,7 +1394,7 @@ int length;
1396 (char *) window + start, length) != EQUAL) { 1394 (char *) window + start, length) != EQUAL) {
1397 fprintf(stderr, 1395 fprintf(stderr,
1398 " start %d, match %d, length %d\n", start, match, length); 1396 " start %d, match %d, length %d\n", start, match, length);
1399 error("invalid match"); 1397 errorMsg("invalid match");
1400 } 1398 }
1401 if (verbose > 1) { 1399 if (verbose > 1) {
1402 fprintf(stderr, "\\[%d,%d]", start - match, length); 1400 fprintf(stderr, "\\[%d,%d]", start - match, length);
@@ -2916,7 +2914,7 @@ int eof; /* true if this is the last block for a file */
2916#endif 2914#endif
2917 /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ 2915 /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
2918 if (buf == (char *) 0) 2916 if (buf == (char *) 0)
2919 error("block vanished"); 2917 errorMsg("block vanished");
2920 2918
2921 copy_block(buf, (unsigned) stored_len, 0); /* without header */ 2919 copy_block(buf, (unsigned) stored_len, 0); /* without header */
2922 compressed_len = stored_len << 3; 2920 compressed_len = stored_len << 3;
@@ -3099,7 +3097,7 @@ local void set_file_type()
3099 bin_freq += dyn_ltree[n++].Freq; 3097 bin_freq += dyn_ltree[n++].Freq;
3100 *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; 3098 *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
3101 if (*file_type == BINARY && translate_eol) { 3099 if (*file_type == BINARY && translate_eol) {
3102 warn("-l used on binary file", ""); 3100 errorMsg("-l used on binary file", "");
3103 } 3101 }
3104} 3102}
3105 3103
@@ -3259,13 +3257,13 @@ char *env; /* name of environment variable */
3259 nargv = (char **) calloc(*argcp + 1, sizeof(char *)); 3257 nargv = (char **) calloc(*argcp + 1, sizeof(char *));
3260 3258
3261 if (nargv == NULL) 3259 if (nargv == NULL)
3262 error("out of memory"); 3260 errorMsg("out of memory");
3263 oargv = *argvp; 3261 oargv = *argvp;
3264 *argvp = nargv; 3262 *argvp = nargv;
3265 3263
3266 /* Copy the program name first */ 3264 /* Copy the program name first */
3267 if (oargc-- < 0) 3265 if (oargc-- < 0)
3268 error("argc<=0"); 3266 errorMsg("argc<=0");
3269 *(nargv++) = *(oargv++); 3267 *(nargv++) = *(oargv++);
3270 3268
3271 /* Then copy the environment args */ 3269 /* Then copy the environment args */