commit 70944bdbd189b73a440e32fbaf6dd0c4c3792b08
parent c4e88f6a4daf7c8198c9f0ffd5010e3749624166
Author: Benjamin Paul <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);