From 844306dbe4ac29ffacf29d09f68338cfb3b8fd2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marciniak?= <50745572+sunwire@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:52:30 +0100 Subject: [PATCH] cast to proper type (#38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł Marciniak --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0e3fcfe..633f167 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -602,7 +602,7 @@ std::string randomKey(int length) { if (random.is_open()) { for (int i = 0; i < length; i++) { random.read(reinterpret_cast(&rnd), 1); - retval << std::hex << rnd; + retval << std::hex << std::setfill('0') << setw(2) << static_cast(rnd); } random.close(); } else {