aboutsummaryrefslogtreecommitdiff
path: root/miscutils/bbconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/bbconfig.c')
-rw-r--r--miscutils/bbconfig.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c
index aa42de648..077e03c5d 100644
--- a/miscutils/bbconfig.c
+++ b/miscutils/bbconfig.c
@@ -44,29 +44,10 @@ int bbconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
44int bbconfig_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 44int bbconfig_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
45{ 45{
46#if ENABLE_FEATURE_COMPRESS_BBCONFIG 46#if ENABLE_FEATURE_COMPRESS_BBCONFIG
47 bunzip_data *bd; 47 const char *outbuf = unpack_bz2_data(bbconfig_config_bz2,
48 int i; 48 sizeof(bbconfig_config_bz2), sizeof(bbconfig_config));
49 jmp_buf jmpbuf; 49 if (outbuf) {
50 50 full_write1_str(outbuf);
51 /* Setup for I/O error handling via longjmp */
52 i = setjmp(jmpbuf);
53 if (i == 0) {
54 i = start_bunzip(&jmpbuf,
55 &bd,
56 /* src_fd: */ -1,
57 /* inbuf: */ bbconfig_config_bz2,
58 /* len: */ sizeof(bbconfig_config_bz2)
59 );
60 }
61 /* read_bunzip can longjmp and end up here with i != 0
62 * on read data errors! Not trivial */
63 if (i == 0) {
64 /* Cannot use xmalloc: will leak bd in NOFORK case! */
65 char *outbuf = malloc_or_warn(sizeof(bbconfig_config));
66 if (outbuf) {
67 read_bunzip(bd, outbuf, sizeof(bbconfig_config));
68 full_write1_str(outbuf);
69 }
70 } 51 }
71#else 52#else
72 full_write1_str(bbconfig_config); 53 full_write1_str(bbconfig_config);