aboutsummaryrefslogtreecommitdiff
path: root/gunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'gunzip.c')
-rw-r--r--gunzip.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gunzip.c b/gunzip.c
index bdf8dc293..11fc3a8f9 100644
--- a/gunzip.c
+++ b/gunzip.c
@@ -28,13 +28,17 @@
28 */ 28 */
29 29
30#include "internal.h" 30#include "internal.h"
31
31static const char gunzip_usage[] = 32static const char gunzip_usage[] =
32 "gunzip [OPTION]... FILE\n\n" 33 "gunzip [OPTION]... FILE\n"
33 "Uncompress FILE (or standard input if FILE is '-').\n\n" 34#ifndef BB_FEATURE_TRIVIAL_HELP
35 "\nUncompress FILE (or standard input if FILE is '-').\n\n"
34 "Options:\n" 36 "Options:\n"
35 37
36 "\t-c\tWrite output to standard output\n" 38 "\t-c\tWrite output to standard output\n"
37 "\t-t\tTest compressed file integrity\n"; 39 "\t-t\tTest compressed file integrity\n"
40#endif
41 ;
38 42
39 43
40 /* These defines are very important for BusyBox. Without these, 44 /* These defines are very important for BusyBox. Without these,
@@ -43,8 +47,9 @@ static const char gunzip_usage[] =
43#define SMALL_MEM 47#define SMALL_MEM
44#define DYN_ALLOC 48#define DYN_ALLOC
45 49
46#define bb_need_name_too_long
47#define BB_DECLARE_EXTERN 50#define BB_DECLARE_EXTERN
51#define bb_need_memory_exhausted
52#define bb_need_name_too_long
48#include "messages.c" 53#include "messages.c"
49 54
50 55
@@ -206,7 +211,7 @@ extern int method; /* compression method */
206# define DECLARE(type, array, size) type * array 211# define DECLARE(type, array, size) type * array
207# define ALLOC(type, array, size) { \ 212# define ALLOC(type, array, size) { \
208 array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \ 213 array = (type*)calloc((size_t)(((size)+1L)/2), 2*sizeof(type)); \
209 if (array == NULL) errorMsg("insufficient memory"); \ 214 if (array == NULL) errorMsg(memory_exhausted, "gunzip"); \
210 } 215 }
211# define FREE(array) {if (array != NULL) free(array), array=NULL;} 216# define FREE(array) {if (array != NULL) free(array), array=NULL;}
212#else 217#else
@@ -1053,7 +1058,7 @@ int in, out; /* input and output file descriptors */
1053 int res = inflate(); 1058 int res = inflate();
1054 1059
1055 if (res == 3) { 1060 if (res == 3) {
1056 errorMsg("out of memory"); 1061 errorMsg(memory_exhausted, "gunzip");
1057 } else if (res != 0) { 1062 } else if (res != 0) {
1058 errorMsg("invalid compressed data--format violated"); 1063 errorMsg("invalid compressed data--format violated");
1059 } 1064 }