aboutsummaryrefslogtreecommitdiff
path: root/gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzip.c')
-rw-r--r--gzip.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gzip.c b/gzip.c
index f132679f7..e275fa274 100644
--- a/gzip.c
+++ b/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 */