summaryrefslogtreecommitdiffstats
path: root/decoder.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--decoder.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/decoder.c b/decoder.c
index cd3e774..dc12b72 100644
--- a/decoder.c
+++ b/decoder.c
@@ -38,11 +38,10 @@ void Pp_show_msg( struct Pretty_print * const pp, const char * const msg )
{
if( pp->first_post )
{
- int i, len;
+ int i, len = pp->longest_name - strlen( pp->name );
pp->first_post = false;
fprintf( stderr, " %s: ", pp->name );
- len = pp->longest_name - strlen( pp->name );
- for( i = 0; i < len; ++i ) fprintf( stderr, " " );
+ for( i = 0; i < len; ++i ) fputc( ' ', stderr );
if( !msg ) fflush( stderr );
}
if( msg ) fprintf( stderr, "%s\n", msg );
@@ -153,7 +152,7 @@ static bool LZd_verify_trailer( struct LZ_decoder * const d,
if( verbosity >= 0 )
{
Pp_show_msg( pp, 0 );
- fprintf( stderr, "CRC mismatch; trailer says %08X, data CRC is %08X.\n",
+ fprintf( stderr, "CRC mismatch; trailer says %08X, data CRC is %08X\n",
trailer_crc, LZd_crc( d ) );
}
}
@@ -164,7 +163,7 @@ static bool LZd_verify_trailer( struct LZ_decoder * const d,
if( verbosity >= 0 )
{
Pp_show_msg( pp, 0 );
- fprintf( stderr, "Data size mismatch; trailer says %llu, data size is %llu (0x%llX).\n",
+ fprintf( stderr, "Data size mismatch; trailer says %llu, data size is %llu (0x%llX)\n",
trailer_data_size, LZd_data_position( d ), LZd_data_position( d ) );
}
}
@@ -175,7 +174,7 @@ static bool LZd_verify_trailer( struct LZ_decoder * const d,
if( verbosity >= 0 )
{
Pp_show_msg( pp, 0 );
- fprintf( stderr, "Member size mismatch; trailer says %llu, member size is %llu (0x%llX).\n",
+ fprintf( stderr, "Member size mismatch; trailer says %llu, member size is %llu (0x%llX)\n",
trailer_member_size, member_size, member_size );
}
}
@@ -224,7 +223,7 @@ int LZd_decode_member( struct LZ_decoder * const d,
LZd_peek( d, rep0 ) ) );
}
}
- else
+ else /* match or repeated match */
{
int len;
if( Rd_decode_bit( rdec, &d->bm_rep[state] ) != 0 ) /* 2nd bit */
@@ -254,7 +253,7 @@ int LZd_decode_member( struct LZ_decoder * const d,
state = St_set_rep( state );
len = min_match_len + Rd_decode_len( rdec, &d->rep_len_model, pos_state );
}
- else
+ else /* match */
{
int dis_slot;
const unsigned rep0_saved = rep0;
@@ -288,7 +287,7 @@ int LZd_decode_member( struct LZ_decoder * const d,
if( verbosity >= 0 )
{
Pp_show_msg( pp, 0 );
- fprintf( stderr, "Unsupported marker code '%d'.\n", len );
+ fprintf( stderr, "Unsupported marker code '%d'\n", len );
}
return 4;
}