};
#endif
-#include "busybox.h"
#include <getopt.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdlib.h>
#include <time.h>
#include <dirent.h>
+#include "busybox.h"
#define BB_DECLARE_EXTERN
#define bb_need_memory_exhausted
#define bb_need_name_too_long
method = (int) get_byte();
if (method != DEFLATED) {
- error_msg("unknown method %d -- get newer version of gzip\n", method);
+ error_msg("unknown method %d -- get newer version of gzip", method);
exit_code = ERROR;
return -1;
}
if (res == 3) {
error_msg(memory_exhausted);
} else if (res != 0) {
- error_msg("invalid compressed data--format violated\n");
+ error_msg("invalid compressed data--format violated");
}
} else {
- error_msg("internal error, invalid method\n");
+ error_msg("internal error, invalid method");
}
/* Get the crc and original length */
/* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) {
- error_msg("invalid compressed data--crc error\n");
+ error_msg("invalid compressed data--crc error");
}
if (orig_len != (ulg) bytes_out) {
- error_msg("invalid compressed data--length error\n");
+ error_msg("invalid compressed data--length error");
}
/* Check if there are more entries in a pkzip file */
if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) {
- fprintf(stderr, "has more than one entry--rest ignored\n");
+ error_msg("has more than one entry--rest ignored");
if (exit_code == OK)
exit_code = WARNING;
}
int force = 0;
struct stat statBuf;
char *delFileName;
- char ifname[MAX_PATH_LEN + 1]; /* input file name */
- char ofname[MAX_PATH_LEN + 1]; /* output file name */
+ RESERVE_BB_BUFFER(ifname, MAX_PATH_LEN+1); /* input file name */
+ RESERVE_BB_BUFFER(ofname, MAX_PATH_LEN+1); /* output file name */
method = DEFLATED; /* default compression method */
exit_code = OK; /* let's go out on a limb and assume everything will run fine (wink wink) */
force = 1;
break;
default:
- usage(gunzip_usage);
+ show_usage();
}
}
}
}
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
- error_msg_and_die( "data not read from terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not read from terminal. Use -f to force it.");
if (isatty(fileno(stdout)) && tostdout==1 && force==0)
- error_msg_and_die( "data not written to terminal. Use -f to force it.\n");
+ error_msg_and_die( "data not written to terminal. Use -f to force it.");
gunzip_init();
} else {
/* Open up the input file */
if (argc <= 0)
- usage(gunzip_usage);
+ show_usage();
if (strlen(*argv) > MAX_PATH_LEN) {
error_msg(name_too_long);
exit(WARNING);