aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-05-28 06:55:14 +0200
committerSven Gothel <[email protected]>2022-05-28 06:55:14 +0200
commit7232745fc99f60e4093c24ba972a63a2366690ec (patch)
treec9d875c90db588e66669d075cacdedcfc97a1f60
parentde74c795053a1d64fc2a885fd6bd1227ca428bb1 (diff)
Fix to_integer(): Clear errno before std::strtoll()
-rw-r--r--src/basic_types.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic_types.cpp b/src/basic_types.cpp
index 651973f..7ede6be 100644
--- a/src/basic_types.cpp
+++ b/src/basic_types.cpp
@@ -406,6 +406,7 @@ static bool to_integer(long long & result, const char * str, size_t str_len, con
if( nullptr == limiter_pos ) {
limiter_pos = str + str_len;
}
+ errno = 0;
const long long num = std::strtoll(str, &endptr, 10);
if( 0 != errno ) {
// value under- or overflow occured