Commit 17cc6531 authored by Huff, Israel's avatar Huff, Israel
Browse files

Fortify changes

parent c2d02242
Pipeline #71388 passed with stages
in 16 minutes and 39 seconds
......@@ -131,21 +131,43 @@ std::string remove_extra_whitespace(const std::string &inputStr)
struct std::tm utc_to_time(const std::string &time, int &zone, int &daylight)
{
int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
int count = sscanf(time.c_str(), "%d-%d-%dT%d:%d:%d-%d:%d", &year, &month,
&day, &hour, &minute, &second, &zone, &daylight);
(void)sizeof(count);
int times[8] = {0, 0, 0, 0, 0, 0, 0, 0};
int count = 0;
// count = sscanf(time.c_str(), "%d-%d-%dT%d:%d:%d-%d:%d", &year, &month,
// &day, &hour, &minute, &second, &zone, &daylight);
size_t start = 0;
for (size_t i = 0; i < time.size(); i++)
{
if (time[i] < '0' || time[i] > '9')
{
try
{
times[count] = std::stoi(time.substr(start, i - start));
}
catch (...)
{
times[count] = 0;
}
start = i + 1;
count++;
}
}
radix_line("utc_to_time elements: " << count);
struct std::tm res;
res.tm_year = year;
res.tm_mon = month;
res.tm_mday = day;
res.tm_hour = hour;
res.tm_min = minute;
res.tm_sec = second;
res.tm_year = times[0];
res.tm_mon = times[1];
res.tm_mday = times[2];
res.tm_hour = times[3];
res.tm_min = times[4];
res.tm_sec = times[5];
zone = times[6];
daylight = times[7];
res.tm_isdst = daylight;
radix_line("Parsed time:" << year << "-" << month << "-" << day << "T" << hour
<< ":" << minute << ":" << second << "-" << zone
radix_line("Parsed time:" << res.tm_year << "-" << res.tm_mon << "-"
<< res.tm_mday << "T" << res.tm_hour << ":"
<< res.tm_min << ":" << res.tm_sec << "-" << zone
<< ":" << daylight);
return res;
}
......
......@@ -22,6 +22,8 @@ NavigationActionManager::NavigationActionManager(QObject *parent)
{
}
NavigationActionManager::PImpl::~PImpl() {}
NavigationActionManager::~NavigationActionManager() { delete p; }
void NavigationActionManager::registerAction(NavigationItem *item, QString text,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment