From f5c707a68dc48ba51c7a31a581f966e9fbae5d34 Mon Sep 17 00:00:00 2001 From: Christophe Greisberger Date: Sun, 22 Mar 2026 19:27:38 +0100 Subject: [PATCH 1/2] Fixed wrong numeric limit for floating types --- lib/inc/drogon/utils/Utilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inc/drogon/utils/Utilities.h b/lib/inc/drogon/utils/Utilities.h index 23412500e5..9941387919 100644 --- a/lib/inc/drogon/utils/Utilities.h +++ b/lib/inc/drogon/utils/Utilities.h @@ -497,7 +497,7 @@ T fromString(const std::string &p) noexcept(false) // ("1a" should not return 1) if (pos != p.size()) throw std::invalid_argument("Invalid value"); - if ((v < static_cast((std::numeric_limits::min)())) || + if ((v < static_cast((std::numeric_limits::lowest)())) || (v > static_cast((std::numeric_limits::max)()))) throw std::out_of_range("Value out of range"); return static_cast(v); From 52f6064aab5e711da2d94ea9ce3d1e78ece355c3 Mon Sep 17 00:00:00 2001 From: Christophe Greisberger Date: Sun, 22 Mar 2026 19:57:51 +0100 Subject: [PATCH 2/2] Fixed formatting --- lib/inc/drogon/utils/Utilities.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/inc/drogon/utils/Utilities.h b/lib/inc/drogon/utils/Utilities.h index 9941387919..6b856bfd02 100644 --- a/lib/inc/drogon/utils/Utilities.h +++ b/lib/inc/drogon/utils/Utilities.h @@ -497,7 +497,8 @@ T fromString(const std::string &p) noexcept(false) // ("1a" should not return 1) if (pos != p.size()) throw std::invalid_argument("Invalid value"); - if ((v < static_cast((std::numeric_limits::lowest)())) || + if ((v < + static_cast((std::numeric_limits::lowest)())) || (v > static_cast((std::numeric_limits::max)()))) throw std::out_of_range("Value out of range"); return static_cast(v);