fixed client_test to be able to print empty piece bars

This commit is contained in:
Arvid Norberg 2008-08-29 00:42:57 +00:00
parent 9b38724417
commit eaffa85c54
1 changed files with 6 additions and 0 deletions

View File

@ -263,6 +263,12 @@ std::string const& piece_bar(libtorrent::bitfield const& p, int width)
bar.clear(); bar.clear();
bar.reserve(width * 6); bar.reserve(width * 6);
bar += "["; bar += "[";
if (p.size() == 0)
{
for (int i = 0; i < width; ++i) bar += ' ';
bar += "]";
return bar;
}
// the [piece, piece + pieces_per_char) range is the pieces that are represented by each character // the [piece, piece + pieces_per_char) range is the pieces that are represented by each character
double piece = 0; double piece = 0;