[Commits] [SCM] claws branch, master, updated. 4.1.1-110-g1a795ba0b

jonathan at claws-mail.org jonathan at claws-mail.org
Sun Nov 5 05:34:25 UTC 2023


The branch, master has been updated
       via  1a795ba0b6f680faa7b4c58e6f39b1f62d61a13d (commit)
      from  9d22fe3a0d1b643a265c9cb4ef9498cc15a0c38a (commit)

Summary of changes:
 src/plugins/vcalendar/vcal_manager.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit 1a795ba0b6f680faa7b4c58e6f39b1f62d61a13d
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