[Commits] [SCM] claws branch, gtk2, updated. 3.19.1-94-gc1654e793
jonathan at claws-mail.org
jonathan at claws-mail.org
Sun Nov 5 05:34:49 UTC 2023
The branch, gtk2 has been updated
via c1654e793e7ce8a8c4acffd57adcf4197b47a32d (commit)
from d59998f2cd37d1a7d5b4a7a02f61e73afa02c702 (commit)
Summary of changes:
src/plugins/vcalendar/vcal_manager.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit c1654e793e7ce8a8c4acffd57adcf4197b47a32d
Author: Jonathan Boeing <jonathan at claws-mail.org>
Date: Sat Nov 4 20:59:18 2023 -0700
Fix -Wstringop-truncation warnings
diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c
index 1061a1243..b7f6c6d25 100644
--- a/src/plugins/vcalendar/vcal_manager.c
+++ b/src/plugins/vcalendar/vcal_manager.c
@@ -536,10 +536,23 @@ static void get_rfc822_date_from_time_t(gchar *buf, gint len, time_t t)
day, dd, mon, yyyy, hh, mm, ss, tzoffset(&t));
#else
GDateTime *dt = g_date_time_new_from_unix_local(t);
- gchar *buf2 = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+ if (dt == NULL) {
+ g_warning("failed getting date/time");
+ g_snprintf(buf, len, "(NULL)");
+ return;
+ }
+
+ gchar *ret = g_date_time_format(dt, "%a, %e %b %Y %T %z");
g_date_time_unref(dt);
- strncpy(buf, buf2, len);
- g_free(buf2);
+
+ if (ret == NULL) {
+ g_warning("failed formatting date/time");
+ g_snprintf(buf, len, "(NULL)");
+ return;
+ }
+
+ g_snprintf(buf, len, ret);
+ g_free(ret);
#endif
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list