From: Lars Hjemli Date: Sat, 23 Feb 2008 19:13:57 +0000 (+0100) Subject: Merge branch 'stable' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/e0572c39f78b4f88c706a49a60e211302b8e015c?hp=-c Merge branch 'stable' * stable: Fix segfault Signed-off-by: Lars Hjemli --- e0572c39f78b4f88c706a49a60e211302b8e015c diff --combined html.c index eb163d9,d531c20..339bf00 --- a/html.c +++ b/html.c @@@ -48,9 -48,7 +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 +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 +80,8 @@@ } 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 +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=='<') @@@ -132,7 -122,7 +122,7 @@@ void html_option(char *value, char *tex html_attr(value); html("'"); if (selected_value && !strcmp(selected_value, value)) - html(" selected"); + html(" selected='selected'"); html(">"); html_txt(text); html("\n");