From c41018bc5a7369786fde903ad7d49756a578c3e7 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:32:01 +0200 Subject: [PATCH] Util: fixed undefined behavior --- src/util.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 9d435ac..5d22dfc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1017,9 +1017,7 @@ hash from_onion_v3(const std::string& address) // Convert address to lowercase std::string s = address; - for (char& c : s) { - c = static_cast(std::tolower(c)); - } + std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { return static_cast(std::tolower(c)); }); // Checksum validation if (to_onion_v3(result) != s) {