From ea7bebb604ef1fc8b1de45f38a604fad590b52f5 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 4 Oct 2008 12:21:28 +0100 Subject: [PATCH 1/1] Fix single digit day in engine_name() Signed-off-by: Marco Costalba --- src/misc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc.cpp b/src/misc.cpp index 237ca8d7..07d58d63 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -78,8 +78,10 @@ const std::string engine_name() { size_t mon = 1 + months.find(date.substr(0, 3)) / 4; std::stringstream s; + std::string day = (date[4] == ' ' ? date.substr(5, 1) : date.substr(4, 2)); + s << "Glaurung clone " << date.substr(date.length() - 2) << std::setfill('0') - << std::setw(2) << mon << date.substr(4, 2); + << std::setw(2) << mon << std::setw(2) << day; return s.str(); } else -- 2.39.2