From 87f18b53a065b84aebdece27da3e6ab72fd624d3 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 4 Jan 2022 16:40:28 +0100 Subject: [PATCH] [string] Check for NULL --- src/document/gemini/renderer.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/document/gemini/renderer.c b/src/document/gemini/renderer.c index 4861a752..7fbaf5a1 100644 --- a/src/document/gemini/renderer.c +++ b/src/document/gemini/renderer.c @@ -136,7 +136,9 @@ render_gemini_document(struct cache_entry *cached, struct document *document, &document->cp_status, document->options.hard_assume); - init_string(&html); + if (!init_string(&html)) { + return; + } uristring = get_uri_string(document->uri, URI_PUBLIC); add_to_string(&html, "= 4 - && !strncmp(html_line.source, "
  • ", 4)) { - if (!in_list) { - in_list = 1; - add_to_string(&html, "\n"); - add_string_to_string(&html, &html_line); - } else { - add_string_to_string(&html, &html_line); + done_string(&html_line); } - done_string(&html_line); } } begin = i + 1;