summaryrefslogtreecommitdiffstats
path: root/rc.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:38:54 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:38:54 +0000
commitbdbf8e64012d4c5737f2bebbe2a0174ddb4923b8 (patch)
tree69575a82eaab8c2c45f656429fa0901a7da8e124 /rc.cc
parentAdding debian version 1.3~pre2-1. (diff)
downloadzutils-bdbf8e64012d4c5737f2bebbe2a0174ddb4923b8.tar.xz
zutils-bdbf8e64012d4c5737f2bebbe2a0174ddb4923b8.zip
Merging upstream version 1.3~rc1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'rc.cc')
-rw-r--r--rc.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/rc.cc b/rc.cc
index 3b78f2b..211bcee 100644
--- a/rc.cc
+++ b/rc.cc
@@ -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;
}