fix: warnings from clang tidy sonarcloud coverity (#4143)

This commit is contained in:
Charles Kerr
2022-11-12 09:53:09 -06:00
committed by GitHub
parent 48e42ac71e
commit 250e055c1d
15 changed files with 97 additions and 85 deletions

View File

@@ -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)