From a2541e362769a28ee723d61a2e4c472f3efa1f72 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 23 Aug 2019 15:52:58 -0700 Subject: [PATCH] ircd::util: Limit iteration. --- ircd/util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ircd/util.cc b/ircd/util.cc index 7b566ebb3..315763b22 100644 --- a/ircd/util.cc +++ b/ircd/util.cc @@ -219,7 +219,7 @@ ircd::util::pretty_nanoseconds(const mutable_buffer &out, size_t i(0), pos(0); long double val(ns); - for(; val > std::get<1>(unit.at(pos)); ++pos) + for(; val > std::get<1>(unit.at(pos)) && pos < unit.size() - 1; ++pos) val /= std::get<1>(unit.at(pos)); return fmt::sprintf