From 7a488b93d04a66bc83b133a7be56bc9717b329d2 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Wed, 16 Jun 2021 20:51:08 +0200 Subject: [PATCH] Set decimal base for converting subseconds to int The leading 0 triggers an automatic conversion as an octal value. This fails because it is a decimal value. Setting the base to 10 prevents this automatism and treats the value as a decimal value. Fixes: [WAN] string_util.cpp:cvt_strtoofft(96): something error is occurred in convert std::string(017080564) to off_t, thus return 0 as default. Related to #1676 --- src/metaheader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metaheader.cpp b/src/metaheader.cpp index 2785793..31ad7d8 100644 --- a/src/metaheader.cpp +++ b/src/metaheader.cpp @@ -45,7 +45,7 @@ static struct timespec cvt_string_to_time(const char *str) strmtime = str; std::string::size_type pos = strmtime.find('.', 0); if(std::string::npos != pos){ - nsec = cvt_strtoofft(strmtime.substr(pos + 1).c_str()); + nsec = cvt_strtoofft(strmtime.substr(pos + 1).c_str(), 10); strmtime.erase(pos); } }