fix signed/unsigned comparison
authorMichael Andres <ma@suse.de>
Fri, 16 May 2014 08:55:00 +0000 (10:55 +0200)
committerMichael Andres <ma@suse.de>
Fri, 16 May 2014 08:55:00 +0000 (10:55 +0200)
src/output/Out.cc

index bb80033..fa38cd0 100644 (file)
@@ -46,7 +46,8 @@ std::string TermLine::get( unsigned width_r, SplitFlags flags_r, char exp_r ) co
     if ( percentHint == 0 )
       return zypp::str::Str() << l << std::string( diff, '-' ) << r;
 
-    int pc = diff * percentHint / 100;
+
+    unsigned pc = diff * percentHint / 100; // diff > 0 && percentHint > 0
     if ( diff < 6 )    // not enough space for fancy stuff
       return zypp::str::Str() << l <<  std::string( pc, '.' ) << std::string( diff-pc, '=' ) << r;