aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 00:26:31 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-07-20 23:52:52 +0200
commitcc714d9006553f852f41954e2e9f55e7ee57accd (patch)
tree153c0a676ec2058eae614da84618e68d068e592e /html.c
parent5b0faff8e6035d9dab6482e6cade78129e1f1e2d (diff)
html.c: Allow empty strings on html_encode
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/html.c b/html.c
index 95d26b9..cad966b 100644
--- a/html.c
+++ b/html.c
@@ -24,6 +24,12 @@ static char *html_encode(const char *s)
dynstr_init(&d);
+ if (!*s && dynstr_append(&d, ""))
+ {
+ fprintf(stderr, "%s: dynstr_append empty failed\n", __func__);
+ goto failure;
+ }
+
while (*s)
{
static const struct esc