idiotbox-c

youtube web application in C
git clone git://git.codemadness.org/idiotbox-c
Log | Files | Refs | README | LICENSE

commit 512710515bcfd1aea7b10daa87cd60ad20f7d85f
parent 868362bea6c5dbb0d65cd74acd0d3bc26b0d60b5
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Thu, 28 Jun 2018 20:48:57 +0200

use OUT() macro for xmlencode()

Diffstat:
main.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/main.c b/main.c @@ -108,11 +108,11 @@ xmlencode(const char *s) { for (; *s; s++) { switch(*s) { - case '<': fputs("&lt;", stdout); break; - case '>': fputs("&gt;", stdout); break; - case '\'': fputs("&#39;", stdout); break; - case '&': fputs("&amp;", stdout); break; - case '"': fputs("&quot;", stdout); break; + case '<': OUT("&lt;"); break; + case '>': OUT("&gt;"); break; + case '\'': OUT("&#39;"); break; + case '&': OUT("&amp;"); break; + case '"': OUT("&quot;"); break; default: putchar(*s); } }