diff options
Diffstat (limited to 'gzip.c')
-rw-r--r-- | gzip.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -114,7 +114,7 @@ extern int method; /* compression method */ | |||
114 | # define DECLARE(type, array, size) type * array | 114 | # define DECLARE(type, array, size) type * array |
115 | # define ALLOC(type, array, size) { \ | 115 | # define ALLOC(type, array, size) { \ |
116 | array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ | 116 | array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ |
117 | if (array == NULL) errorMsg(memory_exhausted); \ | 117 | if (array == NULL) error_msg(memory_exhausted); \ |
118 | } | 118 | } |
119 | # define FREE(array) {if (array != NULL) free(array), array=NULL;} | 119 | # define FREE(array) {if (array != NULL) free(array), array=NULL;} |
120 | #else | 120 | #else |
@@ -251,7 +251,7 @@ extern int save_orig_name; /* set if original name must be saved */ | |||
251 | 251 | ||
252 | /* Diagnostic functions */ | 252 | /* Diagnostic functions */ |
253 | #ifdef DEBUG | 253 | #ifdef DEBUG |
254 | # define Assert(cond,msg) {if(!(cond)) errorMsg(msg);} | 254 | # define Assert(cond,msg) {if(!(cond)) error_msg(msg);} |
255 | # define Trace(x) fprintf x | 255 | # define Trace(x) fprintf x |
256 | # define Tracev(x) {if (verbose) fprintf x ;} | 256 | # define Tracev(x) {if (verbose) fprintf x ;} |
257 | # define Tracevv(x) {if (verbose>1) fprintf x ;} | 257 | # define Tracevv(x) {if (verbose>1) fprintf x ;} |
@@ -1381,7 +1381,7 @@ int length; | |||
1381 | (char *) window + start, length) != EQUAL) { | 1381 | (char *) window + start, length) != EQUAL) { |
1382 | fprintf(stderr, | 1382 | fprintf(stderr, |
1383 | " start %d, match %d, length %d\n", start, match, length); | 1383 | " start %d, match %d, length %d\n", start, match, length); |
1384 | errorMsg("invalid match\n"); | 1384 | error_msg("invalid match\n"); |
1385 | } | 1385 | } |
1386 | if (verbose > 1) { | 1386 | if (verbose > 1) { |
1387 | fprintf(stderr, "\\[%d,%d]", start - match, length); | 1387 | fprintf(stderr, "\\[%d,%d]", start - match, length); |
@@ -1819,9 +1819,9 @@ int gzip_main(int argc, char **argv) | |||
1819 | } | 1819 | } |
1820 | 1820 | ||
1821 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1821 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1822 | fatalError( "data not read from terminal. Use -f to force it.\n"); | 1822 | error_msg_and_die( "data not read from terminal. Use -f to force it.\n"); |
1823 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) | 1823 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) |
1824 | fatalError( "data not written to terminal. Use -f to force it.\n"); | 1824 | error_msg_and_die( "data not written to terminal. Use -f to force it.\n"); |
1825 | 1825 | ||
1826 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; | 1826 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; |
1827 | if (foreground) { | 1827 | if (foreground) { |
@@ -2900,7 +2900,7 @@ int eof; /* true if this is the last block for a file */ | |||
2900 | #endif | 2900 | #endif |
2901 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ | 2901 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ |
2902 | if (buf == (char *) 0) | 2902 | if (buf == (char *) 0) |
2903 | errorMsg("block vanished\n"); | 2903 | error_msg("block vanished\n"); |
2904 | 2904 | ||
2905 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ | 2905 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ |
2906 | compressed_len = stored_len << 3; | 2906 | compressed_len = stored_len << 3; |
@@ -3083,7 +3083,7 @@ local void set_file_type() | |||
3083 | bin_freq += dyn_ltree[n++].Freq; | 3083 | bin_freq += dyn_ltree[n++].Freq; |
3084 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; | 3084 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; |
3085 | if (*file_type == BINARY && translate_eol) { | 3085 | if (*file_type == BINARY && translate_eol) { |
3086 | errorMsg("-l used on binary file\n"); | 3086 | error_msg("-l used on binary file\n"); |
3087 | } | 3087 | } |
3088 | } | 3088 | } |
3089 | 3089 | ||
@@ -3239,13 +3239,13 @@ char *env; /* name of environment variable */ | |||
3239 | nargv = (char **) calloc(*argcp + 1, sizeof(char *)); | 3239 | nargv = (char **) calloc(*argcp + 1, sizeof(char *)); |
3240 | 3240 | ||
3241 | if (nargv == NULL) | 3241 | if (nargv == NULL) |
3242 | errorMsg(memory_exhausted); | 3242 | error_msg(memory_exhausted); |
3243 | oargv = *argvp; | 3243 | oargv = *argvp; |
3244 | *argvp = nargv; | 3244 | *argvp = nargv; |
3245 | 3245 | ||
3246 | /* Copy the program name first */ | 3246 | /* Copy the program name first */ |
3247 | if (oargc-- < 0) | 3247 | if (oargc-- < 0) |
3248 | errorMsg("argc<=0\n"); | 3248 | error_msg("argc<=0\n"); |
3249 | *(nargv++) = *(oargv++); | 3249 | *(nargv++) = *(oargv++); |
3250 | 3250 | ||
3251 | /* Then copy the environment args */ | 3251 | /* Then copy the environment args */ |