commit 6a86d48750750ead1c357ecc0f3e87803197691a
parent b1fc21cc4ee2207db8e975d23134e27e357ebfb8
Author: bpaul <bpaul@bpaul.xyz>
Date: Fri, 17 Sep 2021 16:20:59 +1000
escape <> characters
Diffstat:
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, "<");
+ else if (*c == '>')
+ fprintf(htmlf, ">");
+ else
+ fputc(*c, htmlf);
}
fprintf(htmlf, end_html);