1
0
Fork 0

Merging upstream version 1.3~rc1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 05:49:21 +01:00
parent 62294b7179
commit 04f94acee5
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
15 changed files with 39 additions and 24 deletions

7
rc.cc
View file

@ -122,8 +122,8 @@ bool parse_rc_line( const std::string & line,
return false; }
const std::string name( line, l, i - l );
int format_index = -1;
for( int i = 0; i < num_formats; ++i )
if( name == format_names[i] ) { format_index = i; break; }
for( int j = 0; j < num_formats; ++j )
if( name == format_names[j] ) { format_index = j; break; }
if( format_index < 0 )
{ if( verbosity >= 0 )
std::fprintf( stderr, "%s %d: bad format name '%s'\n",
@ -226,7 +226,8 @@ void parse_compressor( const std::string & arg, const int format_index,
const char * get_compressor_name( const int format_index )
{
if( format_index >= 0 && format_index < num_formats )
if( format_index >= 0 && format_index < num_formats &&
compressor_names[format_index].size() )
return compressor_names[format_index].c_str();
return 0;
}