bpaul-webgen

html generator for bpaul.xyz
Log | Files | Refs | README

commit 6a86d48750750ead1c357ecc0f3e87803197691a
parent b1fc21cc4ee2207db8e975d23134e27e357ebfb8
Author: bpaul <bpaul@bpaul.xyz>
Date:   Fri, 17 Sep 2021 16:20:59 +1000

escape <> characters

Diffstat:
Mmain.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c @@ -170,7 +170,12 @@ iterate(DIR *d, const char *curdir) { x = 1; y++; } - fputc(*c, htmlf); + if (*c == '<') + fprintf(htmlf, "&lt;"); + else if (*c == '>') + fprintf(htmlf, "&gt;"); + else + fputc(*c, htmlf); } fprintf(htmlf, end_html);