aboutsummaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/html.c b/html.c
index ed6cefc..90cc1c0 100644
--- a/html.c
+++ b/html.c
@@ -92,7 +92,7 @@ void html_status(int code, const char *msg, int more_headers)
92void html_txt(const char *txt) 92void html_txt(const char *txt)
93{ 93{
94 const char *t = txt; 94 const char *t = txt;
95 while(t && *t){ 95 while (t && *t) {
96 int c = *t; 96 int c = *t;
97 if (c == '<' || c == '>' || c == '&') { 97 if (c == '<' || c == '>' || c == '&') {
98 html_raw(txt, t - txt); 98 html_raw(txt, t - txt);
@@ -113,7 +113,7 @@ void html_txt(const char *txt)
113void html_ntxt(int len, const char *txt) 113void html_ntxt(int len, const char *txt)
114{ 114{
115 const char *t = txt; 115 const char *t = txt;
116 while(t && *t && len--){ 116 while (t && *t && len--) {
117 int c = *t; 117 int c = *t;
118 if (c == '<' || c == '>' || c == '&') { 118 if (c == '<' || c == '>' || c == '&') {
119 html_raw(txt, t - txt); 119 html_raw(txt, t - txt);
@@ -136,7 +136,7 @@ void html_ntxt(int len, const char *txt)
136void html_attr(const char *txt) 136void html_attr(const char *txt)
137{ 137{
138 const char *t = txt; 138 const char *t = txt;
139 while(t && *t){ 139 while (t && *t) {
140 int c = *t; 140 int c = *t;
141 if (c == '<' || c == '>' || c == '\'' || c == '\"' || c == '&') { 141 if (c == '<' || c == '>' || c == '\'' || c == '\"' || c == '&') {
142 html_raw(txt, t - txt); 142 html_raw(txt, t - txt);
@@ -161,7 +161,7 @@ void html_attr(const char *txt)
161void html_url_path(const char *txt) 161void html_url_path(const char *txt)
162{ 162{
163 const char *t = txt; 163 const char *t = txt;
164 while(t && *t){ 164 while (t && *t) {
165 unsigned char c = *t; 165 unsigned char c = *t;
166 const char *e = url_escape_table[c]; 166 const char *e = url_escape_table[c];
167 if (e && c != '+' && c != '&') { 167 if (e && c != '+' && c != '&') {
@@ -178,7 +178,7 @@ void html_url_path(const char *txt)
178void html_url_arg(const char *txt) 178void html_url_arg(const char *txt)
179{ 179{
180 const char *t = txt; 180 const char *t = txt;
181 while(t && *t){ 181 while (t && *t) {
182 unsigned char c = *t; 182 unsigned char c = *t;
183 const char *e = url_escape_table[c]; 183 const char *e = url_escape_table[c];
184 if (c == ' ') 184 if (c == ' ')
@@ -260,7 +260,7 @@ int html_include(const char *filename)
260 filename, strerror(errno), errno); 260 filename, strerror(errno), errno);
261 return -1; 261 return -1;
262 } 262 }
263 while((len = fread(buf, 1, 4096, f)) > 0) 263 while ((len = fread(buf, 1, 4096, f)) > 0)
264 html_raw(buf, len); 264 html_raw(buf, len);
265 fclose(f); 265 fclose(f);
266 return 0; 266 return 0;
@@ -310,7 +310,7 @@ int http_parse_querystring(const char *txt_, void (*fn)(const char *name, const
310 printf("Out of memory\n"); 310 printf("Out of memory\n");
311 exit(1); 311 exit(1);
312 } 312 }
313 while((c=*t) != '\0') { 313 while ((c=*t) != '\0') {
314 if (c == '=') { 314 if (c == '=') {
315 *t = '\0'; 315 *t = '\0';
316 value = t + 1; 316 value = t + 1;