commit ec3f28c

green  ·  2025-04-16 00:43:52 +0000 UTC
parent 2890fe2
time-labels: fixed segfault
1 files changed,  +3, -2
M html.c
M html.c
+3, -2
 1@@ -212,10 +212,11 @@ xs_str *format_text_with_emoji(snac *user, const char *text, int ems, const char
 2 
 3 xs_str *html_date_label(snac *user, const char *date)
 4 {
 5-    time_t t = xs_parse_iso_date(date, 0);
 6+    time_t t;
 7 
 8     /* check if a user has actually set a timezone */
 9-    if (t != 0 && xs_dict_get(user->config, "tz") != NULL) {
10+    if (user != NULL && xs_dict_get(user->config, "tz") != NULL &&
11+        (t = xs_parse_iso_date(date, 0)) != 0) {
12         t += xs_tz_offset(user->tz);
13 
14         time_t today = time(NULL);