mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
fix: warnings from clang tidy sonarcloud coverity (#4143)
This commit is contained in:
@@ -616,7 +616,12 @@ double tr_truncd(double x, int decimal_places)
|
||||
pt[decimal_places != 0 ? decimal_places + 1 : 0] = '\0';
|
||||
}
|
||||
|
||||
return *tr_parseNum<double>(std::data(buf));
|
||||
if (auto parsed = tr_parseNum<double>(std::data(buf)); parsed)
|
||||
{
|
||||
return *parsed;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string tr_strpercent(double x)
|
||||
|
||||
Reference in New Issue
Block a user