diff options
| author | 2025-04-16 02:43:52 +0200 | |
|---|---|---|
| committer | 2026-01-23 21:04:16 +0100 | |
| commit | ec3f28ca63f7623c1c7124a0f187ef0cb980a2d8 (patch) | |
| tree | cf659390a6f7946dc561426cb3ade8dc3b03ffe1 /html.c | |
| parent | small: timezone dependant date labels (diff) | |
| download | snac2-ec3f28ca63f7623c1c7124a0f187ef0cb980a2d8.tar.gz snac2-ec3f28ca63f7623c1c7124a0f187ef0cb980a2d8.tar.xz snac2-ec3f28ca63f7623c1c7124a0f187ef0cb980a2d8.zip | |
time-labels: fixed segfault
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -212,10 +212,11 @@ xs_str *format_text_with_emoji(snac *user, const char *text, int ems, const char | |||
| 212 | 212 | ||
| 213 | xs_str *html_date_label(snac *user, const char *date) | 213 | xs_str *html_date_label(snac *user, const char *date) |
| 214 | { | 214 | { |
| 215 | time_t t = xs_parse_iso_date(date, 0); | 215 | time_t t; |
| 216 | 216 | ||
| 217 | /* check if a user has actually set a timezone */ | 217 | /* check if a user has actually set a timezone */ |
| 218 | if (t != 0 && xs_dict_get(user->config, "tz") != NULL) { | 218 | if (user != NULL && xs_dict_get(user->config, "tz") != NULL && |
| 219 | (t = xs_parse_iso_date(date, 0)) != 0) { | ||
| 219 | t += xs_tz_offset(user->tz); | 220 | t += xs_tz_offset(user->tz); |
| 220 | 221 | ||
| 221 | time_t today = time(NULL); | 222 | time_t today = time(NULL); |