Skip to content

Commit 6e16e98

Browse files
committed
Fixed deepcode-ci warnings
1 parent 3e5e206 commit 6e16e98

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/wsjcpp_yaml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ int WsjcppYamlCursor::valInt() {
11441144
if (m_pCurrentNode != nullptr) {
11451145
std::string sValue = m_pCurrentNode->getValue();
11461146
sValue = WsjcppCore::toLower(sValue);
1147-
int nValue = std::atoi(sValue.c_str());
1147+
int nValue = std::strtol(sValue.c_str(), nullptr, 10);
11481148
if (std::to_string(nValue) != sValue) {
11491149
throw std::runtime_error(TAG + ": valInt, Element must be int but have a string" + m_pCurrentNode->getForLogFormat());
11501150
}

unit-tests.wsjcpp/src/process_mem_usage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ void process_mem_usage(double& vm_usage, double& resident_set)
2525
// 'file' stat seems to give the most reliable results
2626
//
2727
ifstream stat_stream("/proc/self/stat",ios_base::in);
28+
if (!stat_stream.is_open()) {
29+
return;
30+
}
2831

2932
// dummy vars for leading entries in stat that we don't care about
3033
//

0 commit comments

Comments
 (0)