Move buf out of inner loop.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 22 Oct 2013 12:03:55 +0000 (13:03 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 22 Oct 2013 12:03:55 +0000 (13:03 +0100)
Since the buf pointer can be used by the stream across multiple
iterations of the loop.

pxzcat.c

index a6becce..4ab8689 100644 (file)
--- a/pxzcat.c
+++ b/pxzcat.c
@@ -462,6 +462,7 @@ worker_thread (void *vp)
   lzma_filter filters[LZMA_FILTERS_MAX + 1];
   lzma_ret r;
   lzma_stream strm = LZMA_STREAM_INIT;
+  uint8_t buf[BUFFER_SIZE];
   char outbuf[BUFFER_SIZE];
   size_t i;
   lzma_bool iter_finished;
@@ -564,7 +565,6 @@ worker_thread (void *vp)
     strm.avail_out = sizeof outbuf;
 
     for (;;) {
-      uint8_t buf[BUFFER_SIZE];
       lzma_action action = LZMA_RUN;
 
       if (strm.avail_in == 0) {