Fix dereference of expired temporaries.

Reported by clang 15.0.7, which will be in Ubuntu 23.04, -Wdangling-gsl
This commit is contained in:
Richard Cohen
2023-03-28 13:53:57 +01:00
committed by John Ralls
parent 17e08d0f43
commit 6ba5bb326a
6 changed files with 21 additions and 14 deletions

View File

@@ -1101,7 +1101,8 @@ qof_strftime(gchar *buf, gsize max, const gchar *format, const struct tm *tm)
gchar *
gnc_date_timestamp (void)
{
return g_strdup(GncDateTime::timestamp().c_str());
auto timestamp = GncDateTime::timestamp();
return g_strdup(timestamp.c_str());
}
/********************************************************************\