summaryrefslogtreecommitdiffstats
path: root/encoder_base.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-25 12:43:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-25 12:43:54 +0000
commitdc114ed0e55813f66a71a56276bc81db6dfa16f1 (patch)
treed3c0b53871caf5f90bb4397ed72533601bb38f6d /encoder_base.c
parentAdding upstream version 1.11. (diff)
downloadclzip-0fb32cb029acfe22c6846475548ef0137ed75d26.tar.xz
clzip-0fb32cb029acfe22c6846475548ef0137ed75d26.zip
Adding upstream version 1.12.upstream/1.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'encoder_base.c')
-rw-r--r--encoder_base.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/encoder_base.c b/encoder_base.c
index 41c7806..7dd7eca 100644
--- a/encoder_base.c
+++ b/encoder_base.c
@@ -1,18 +1,18 @@
-/* Clzip - LZMA lossless data compressor
- Copyright (C) 2010-2019 Antonio Diaz Diaz.
+/* Clzip - LZMA lossless data compressor
+ Copyright (C) 2010-2021 Antonio Diaz Diaz.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _FILE_OFFSET_BITS 64
@@ -95,11 +95,10 @@ bool Mb_init( struct Matchfinder_base * const mb, const int before_size,
if( Mb_read_block( mb ) && !mb->at_stream_end &&
mb->buffer_size < buffer_size_limit )
{
- uint8_t * tmp;
- mb->buffer_size = buffer_size_limit;
- tmp = (uint8_t *)realloc( mb->buffer, mb->buffer_size );
+ uint8_t * const tmp = (uint8_t *)realloc( mb->buffer, buffer_size_limit );
if( !tmp ) { free( mb->buffer ); return false; }
mb->buffer = tmp;
+ mb->buffer_size = buffer_size_limit;
Mb_read_block( mb );
}
if( mb->at_stream_end && mb->stream_pos < dict_size )
@@ -167,7 +166,7 @@ void Re_flush_data( struct Range_encoder * const renc )
}
- /* End Of Stream mark => (dis == 0xFFFFFFFFU, len == min_match_len) */
+/* End Of Stream marker => (dis == 0xFFFFFFFFU, len == min_match_len) */
void LZeb_full_flush( struct LZ_encoder_base * const eb, const State state )
{
int i;