mu-utils: update casting from int64_t -> time_t

Esp. for systems with 32-bit time_t.
This commit is contained in:
Dirk-Jan C. Binnema
2024-04-13 20:06:39 +03:00
parent d3e7b9cf05
commit a6ec43a740
2 changed files with 22 additions and 3 deletions

View File

@ -489,7 +489,7 @@ Mu::parse_date_time(const std::string& dstr, bool is_first, bool utc)
{
struct tm tbuf{};
GDateTime *dtime{};
::time_t t;
gint64 t;
/* one-sided dates */
if (dstr.empty())
@ -531,7 +531,7 @@ Mu::parse_date_time(const std::string& dstr, bool is_first, bool utc)
t = g_date_time_to_unix(dtime);
g_date_time_unref(dtime);
return std::max<::time_t>(t, 0);
return to_time_t(t);
}