From: Sage Weil Date: Tue, 28 May 2019 16:31:27 +0000 (-0500) Subject: mon: fix off-by-one rendering progress bar X-Git-Tag: v14.2.2~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28398%2Fhead;p=ceph.git mon: fix off-by-one rendering progress bar Ensure that if progress is < 1.0, we always have a '.' at the end of the bar. Signed-off-by: Sage Weil (cherry picked from commit 0e49ad74f9ebbefb418f9eb1c8842dbe8f16fa18) --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index b51b9df2fa94..ec6b58f39822 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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) {