]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix off-by-one rendering progress bar 28398/head
authorSage Weil <sage@redhat.com>
Tue, 28 May 2019 16:31:27 +0000 (11:31 -0500)
committerKefu Chai <kchai@redhat.com>
Wed, 5 Jun 2019 04:04:51 +0000 (12:04 +0800)
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>
(cherry picked from commit 0e49ad74f9ebbefb418f9eb1c8842dbe8f16fa18)

src/mon/Monitor.cc

index b51b9df2fa9413f8432ce40a8aa16b356dc94a22..ec6b58f39822bc298c7fc8c12f999600c25e27b8 100644 (file)
@@ -3023,7 +3023,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) {