-rw-r--r-- | html.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -49,7 +49,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(">"); @@ -72,7 +70,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(">"); @@ -85,10 +81,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("..."); @@ -101,7 +93,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(">"); |