From d20c25a72c52e898e21aec441ad1e3e3a46d830d Mon Sep 17 00:00:00 2001 From: kimci86 Date: Mon, 22 Jan 2024 21:32:59 +0100 Subject: [PATCH] Do not show empty password recovery checkpoint --- src/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ab99b01..ed1b436 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -284,16 +284,19 @@ try else if(state == Progress::State::EarlyExit) std::cout << "Found a solution. Stopping." << std::endl; - const auto flagsBefore = std::cout.setf(std::ios::hex, std::ios::basefield); - const auto fillBefore = std::cout.fill('0'); + if(!restart.empty()) + { + const auto flagsBefore = std::cout.setf(std::ios::hex, std::ios::basefield); + const auto fillBefore = std::cout.fill('0'); - std::cout << "You may resume the password recovery with the option: --continue-recovery "; - for(byte c : restart) - std::cout << std::setw(2) << static_cast(c); - std::cout << std::endl; + std::cout << "You may resume the password recovery with the option: --continue-recovery "; + for(byte c : restart) + std::cout << std::setw(2) << static_cast(c); + std::cout << std::endl; - std::cout.fill(fillBefore); - std::cout.flags(flagsBefore); + std::cout.fill(fillBefore); + std::cout.flags(flagsBefore); + } } std::cout << "[" << put_time << "] ";