aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicksphere.ch>2022-01-18 00:00:00 +0000
committerNicholas Johnson <nick@nicksphere.ch>2022-01-18 00:00:00 +0000
commit610450d2dfd2737149f9b47f3570c4d96a9f0361a2b15fce4bbcaed897ccc095 (patch)
treebd8e1050856e172c3395cba655fa03a225f46d7cddcf4742adc4d39d727ec48d
parent78f721b5957e588a35b1474b70c3bb4f213ff55ae1badabaa59eeb2180186324 (diff)
Fix malloc values
-rw-r--r--src/gemini2html.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gemini2html.c b/src/gemini2html.c
index 3d0c855..c71bc58 100644
--- a/src/gemini2html.c
+++ b/src/gemini2html.c
@@ -30,7 +30,7 @@
* "me & you" => "me &amp; you"
*/
char* escape_html_tag(const char* unescaped, const size_t size) {
- char* escaped = malloc(4 * size + 1);
+ char* escaped = malloc(5 * size + 1);
size_t escaped_pos = 0;
char substitute[6] = "";
@@ -62,7 +62,7 @@ char* escape_html_tag(const char* unescaped, const size_t size) {
* ""hello world" => "&quot;hello world&quot;"
*/
char* escape_html_attribute(const char* unescaped, const size_t size) {
- char* escaped = malloc(4 * size + 1);
+ char* escaped = malloc(6 * size + 1);
size_t escaped_pos = 0;
char substitute[7] = "";