From 54c70c33d2fd94999b92690bbde10432d30176b1 Mon Sep 17 00:00:00 2001 From: n_n_n_n <namark@disroot.org> Date: Fri, 30 Apr 2021 20:36:25 +0400 Subject: [PATCH] These existed! --- source/simple/support/misc.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/simple/support/misc.hpp b/source/simple/support/misc.hpp index d8d697a..85d6cfe 100644 --- a/source/simple/support/misc.hpp +++ b/source/simple/support/misc.hpp @@ -6,6 +6,7 @@ #include <stdexcept> #include <string> #include <optional> +#include <cinttypes> #include "range.hpp" @@ -32,7 +33,7 @@ namespace simple::support return std::strtoull(str, end, 0); else if constexpr (std::is_signed_v<N>) { - auto n = std::strtol(str, end, 0); + auto n = std::strtoimax(str, end, 0); constexpr auto limit = range<N>::limit(); if(!limit.intersects(n)) { @@ -43,7 +44,7 @@ namespace simple::support } else if constexpr (std::is_unsigned_v<N>) { - auto n = std::strtoul(str, end, 0); + auto n = std::strtoumax(str, end, 0); if(std::numeric_limits<N>::max() < n) { errno = ERANGE; -- GitLab