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: v15.1.0~2556^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e49ad74f9ebbefb418f9eb1c8842dbe8f16fa18;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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 25599c0c9e50..f92b32658cf0 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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) {