aboutsummaryrefslogtreecommitdiffstats
path: root/lib/decompress_unlzma.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/decompress_unlzma.c')
-rw-r--r--lib/decompress_unlzma.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c
index 951f7277e98a..2787dc560e4b 100644
--- a/lib/decompress_unlzma.c
+++ b/lib/decompress_unlzma.c
@@ -74,6 +74,7 @@ struct rc {
74 uint32_t code; 74 uint32_t code;
75 uint32_t range; 75 uint32_t range;
76 uint32_t bound; 76 uint32_t bound;
77 void (*error)(char *);
77}; 78};
78 79
79 80
@@ -92,7 +93,7 @@ static void INIT rc_read(struct rc *rc)
92{ 93{
93 rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE); 94 rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE);
94 if (rc->buffer_size <= 0) 95 if (rc->buffer_size <= 0)
95 error("unexpected EOF"); 96 rc->error("unexpected EOF");
96 rc->ptr = rc->buffer; 97 rc->ptr = rc->buffer;
97 rc->buffer_end = rc->buffer + rc->buffer_size; 98 rc->buffer_end = rc->buffer + rc->buffer_size;
98} 99}
@@ -536,7 +537,7 @@ STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
536 int(*flush)(void*, unsigned int), 537 int(*flush)(void*, unsigned int),
537 unsigned char *output, 538 unsigned char *output,
538 int *posp, 539 int *posp,
539 void(*error_fn)(char *x) 540 void(*error)(char *x)
540 ) 541 )
541{ 542{
542 struct lzma_header header; 543 struct lzma_header header;
@@ -552,7 +553,7 @@ STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
552 unsigned char *inbuf; 553 unsigned char *inbuf;
553 int ret = -1; 554 int ret = -1;
554 555
555 set_error_fn(error_fn); 556 rc.error = error;
556 557
557 if (buf) 558 if (buf)
558 inbuf = buf; 559 inbuf = buf;
@@ -659,9 +660,9 @@ STATIC int INIT decompress(unsigned char *buf, int in_len,
659 int(*flush)(void*, unsigned int), 660 int(*flush)(void*, unsigned int),
660 unsigned char *output, 661 unsigned char *output,
661 int *posp, 662 int *posp,
662 void(*error_fn)(char *x) 663 void(*error)(char *x)
663 ) 664 )
664{ 665{
665 return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn); 666 return unlzma(buf, in_len - 4, fill, flush, output, posp, error);
666} 667}
667#endif 668#endif