Skip to content

Commit e20a975

Browse files
authored
Fixed wrong numeric limit for floating types (#2471)
Co-authored-by: Christophe Greisberger <christophe@greisberger.fr>
1 parent cff7ccc commit e20a975

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/inc/drogon/utils/Utilities.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,8 @@ T fromString(const std::string &p) noexcept(false)
656656
// ("1a" should not return 1)
657657
if (pos != p.size())
658658
throw std::invalid_argument("Invalid value");
659-
if ((v < static_cast<long double>((std::numeric_limits<T>::min)())) ||
659+
if ((v <
660+
static_cast<long double>((std::numeric_limits<T>::lowest)())) ||
660661
(v > static_cast<long double>((std::numeric_limits<T>::max)())))
661662
throw std::out_of_range("Value out of range");
662663
return static_cast<T>(v);

0 commit comments

Comments
 (0)