-rw-r--r-- | html.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -57,7 +57,5 @@ void html_txt(char *txt) int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); @@ -80,7 +78,5 @@ void html_ntxt(int len, char *txt) int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); @@ -93,10 +89,6 @@ void html_ntxt(int len, char *txt) t++; } - if (t!=txt) { - char c = *t; - *t = '\0'; - html(txt); - *t = c; - } + if (t!=txt) + write(htmlfd, txt, t - txt); if (len<0) html("..."); @@ -109,7 +101,5 @@ void html_attr(char *txt) int c = *t; if (c=='<' || c=='>' || c=='\'') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); |