]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix off-by-one rendering progress bar 28268/head
authorSage Weil <sage@redhat.com>
Tue, 28 May 2019 16:31:27 +0000 (11:31 -0500)
committerSage Weil <sage@redhat.com>
Tue, 28 May 2019 16:31:27 +0000 (11:31 -0500)
Ensure that if progress is < 1.0, we always have a '.' at the end of the
bar.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index 25599c0c9e50f58ede59348b1d9ebcc7a2ef7d60..f92b32658cf07dccba99981ce75fe08810bd7125 100644 (file)
@@ -3031,7 +3031,7 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f)
        ss << "    " << i.second.message << "\n";
        ss << "      [";
        unsigned j;
-       for (j=0; j < i.second.progress * 30; ++j) {
+       for (j = 0; j < (unsigned)(i.second.progress * 30.0); ++j) {
          ss << '=';
        }
        for (; j < 30; ++j) {