Fixes for flaws found by gemini 3.8 on 21/10/26.
This commit is contained in:
parent
41c405a0c5
commit
bc5760eee9
1 changed files with 105 additions and 84 deletions
34
appinfo.cpp
34
appinfo.cpp
|
|
@ -126,9 +126,10 @@ std::string AppInfo::getAfterString() const
|
|||
for(auto &[key,value]: after) {
|
||||
ss << key << "[" << value << "], ";
|
||||
}
|
||||
std::string after = ss.str();
|
||||
after = after.substr(0,after.size() - 2);
|
||||
return after;
|
||||
std::string after_str = ss.str();
|
||||
if(after_str.size() >= 2)
|
||||
after_str = after_str.substr(0, after_str.size() - 2);
|
||||
return after_str;
|
||||
}
|
||||
|
||||
std::string AppInfo::getAfterKeys() const
|
||||
|
|
@ -137,9 +138,10 @@ std::string AppInfo::getAfterKeys() const
|
|||
for(auto &[key,value]: after) {
|
||||
ss << key << ", ";
|
||||
}
|
||||
std::string after = ss.str();
|
||||
after = after.substr(0,after.size() - 2);
|
||||
return after;
|
||||
std::string after_str = ss.str();
|
||||
if(after_str.size() >= 2)
|
||||
after_str = after_str.substr(0, after_str.size() - 2);
|
||||
return after_str;
|
||||
}
|
||||
|
||||
std::string AppInfo::getStringRunMode() const
|
||||
|
|
@ -343,6 +345,7 @@ bool AppInfo::checkValidity()
|
|||
|
||||
void AppInfo::updateNextTimeToRun()
|
||||
{
|
||||
next_time_to_run_parse_failed = false;
|
||||
bool got_run_every = false;
|
||||
bool got_run_at = false;
|
||||
std::chrono::system_clock::time_point every_time_point, at_time_point;
|
||||
|
|
@ -513,9 +516,10 @@ std::optional<std::chrono::system_clock::time_point> AppInfo::parseAtTimeFormat(
|
|||
}
|
||||
auto local_next = std::chrono::local_days{ymd} + time_of_day;
|
||||
if (local_next <= local_now) {
|
||||
std::chrono::year_month_day ymd_next = (current_ymd.year() / current_ymd.month() / target_day) + std::chrono::months(1);
|
||||
auto next_ym = current_ymd.year() / current_ymd.month() + std::chrono::months(1);
|
||||
std::chrono::year_month_day ymd_next = next_ym / target_day;
|
||||
if (!ymd_next.ok()) {
|
||||
ymd_next = ymd_next.year() / ymd_next.month() / std::chrono::last;
|
||||
ymd_next = next_ym / std::chrono::last;
|
||||
}
|
||||
local_next = std::chrono::local_days{ymd_next} + time_of_day;
|
||||
}
|
||||
|
|
@ -781,9 +785,10 @@ std::string AppInfo::AppData::getAfterString() const
|
|||
for(auto &[key,value]: after) {
|
||||
ss << key << "[" << value << "], ";
|
||||
}
|
||||
std::string after = ss.str();
|
||||
after = after.substr(0,after.size() - 2);
|
||||
return after;
|
||||
std::string after_str = ss.str();
|
||||
if(after_str.size() >= 2)
|
||||
after_str = after_str.substr(0, after_str.size() - 2);
|
||||
return after_str;
|
||||
}
|
||||
|
||||
std::string AppInfo::AppData::getAfterKeys() const
|
||||
|
|
@ -792,7 +797,8 @@ std::string AppInfo::AppData::getAfterKeys() const
|
|||
for(auto &[key,value]: after) {
|
||||
ss << key << ", ";
|
||||
}
|
||||
std::string after = ss.str();
|
||||
after = after.substr(0,after.size() - 2);
|
||||
return after;
|
||||
std::string after_str = ss.str();
|
||||
if(after_str.size() >= 2)
|
||||
after_str = after_str.substr(0, after_str.size() - 2);
|
||||
return after_str;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue