diff options
| author | 2025-04-13 21:23:01 +0200 | |
|---|---|---|
| committer | 2026-01-24 02:23:16 +0100 | |
| commit | 207d9e0f01b1703ed55b00825ef65be49576254b (patch) | |
| tree | 34d35c5b740579d26097827f9dbc7b70c483e1ca | |
| parent | small: configurable poll limit (diff) | |
| download | snac2-207d9e0f01b1703ed55b00825ef65be49576254b.tar.gz snac2-207d9e0f01b1703ed55b00825ef65be49576254b.tar.xz snac2-207d9e0f01b1703ed55b00825ef65be49576254b.zip | |
small: fix segfault for poll options
| -rw-r--r-- | html.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -780,7 +780,8 @@ xs_html *html_note(snac *user, const char *summary, | |||
| 780 | if (poll) { | 780 | if (poll) { |
| 781 | const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options"); | 781 | const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options"); |
| 782 | xs *poll_limit_str = xs_dup(L("Poll options (one per line, up to 8):")); | 782 | xs *poll_limit_str = xs_dup(L("Poll options (one per line, up to 8):")); |
| 783 | poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options)); | 783 | if (max_options != NULL) |
| 784 | poll_limit_str = xs_replace_i(poll_limit_str, "8", xs_number_str(max_options)); | ||
| 784 | 785 | ||
| 785 | xs_html_add(form, | 786 | xs_html_add(form, |
| 786 | xs_html_tag("p", NULL), | 787 | xs_html_tag("p", NULL), |