diff options
author | Lars Hjemli <hjemli@gmail.com> | 2008-02-23 19:13:57 +0000 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-02-23 19:14:01 +0000 |
commit | e0572c39f78b4f88c706a49a60e211302b8e015c (patch) | |
tree | 4432d0400549c7ea521eea1dffddfbb2f96de0c6 /html.c | |
parent | e5ed227ef0da561e2bde8646ec816842392377ee (diff) | |
parent | eacde43d7184452e1fdc90b982b531f1f5239923 (diff) | |
download | cgit-e0572c39f78b4f88c706a49a60e211302b8e015c.tar cgit-e0572c39f78b4f88c706a49a60e211302b8e015c.tar.gz cgit-e0572c39f78b4f88c706a49a60e211302b8e015c.zip |
Merge branch 'stable'
* stable:
Fix segfault
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -48,9 +48,7 @@ void html_txt(char *txt) while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); else if (c=='<') @@ -71,9 +69,7 @@ void html_ntxt(int len, char *txt) while(t && *t && len--){ int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); else if (c=='<') @@ -84,12 +80,8 @@ 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("..."); } @@ -100,9 +92,7 @@ void html_attr(char *txt) while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='\'') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html(">"); else if (c=='<') |