summaryrefslogtreecommitdiff
path: root/src/htmlerror.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2003-05-31 23:02:21 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2003-05-31 23:02:21 +0000
commit77ca1c8ce0df4d7733bb5a382ca8c18adba93e1c (patch)
tree75dee7eb6b1f1de3ddbdd4104a2fdd112322f27a /src/htmlerror.c
parent86c9d6908606c7c47d305b46a242a417c0f22673 (diff)
downloadtinyproxy-77ca1c8ce0df4d7733bb5a382ca8c18adba93e1c.tar.gz
tinyproxy-77ca1c8ce0df4d7733bb5a382ca8c18adba93e1c.zip
# Changed all the for calls to use the != test rather than < test.
The change was recommended in the C/C++ User Journal magazine.
Diffstat (limited to '')
-rw-r--r--src/htmlerror.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/htmlerror.c b/src/htmlerror.c
index 008ac2f..c0eeb86 100644
--- a/src/htmlerror.c
+++ b/src/htmlerror.c
@@ -1,4 +1,4 @@
-/* $Id: htmlerror.c,v 1.4 2003-04-01 16:41:33 rjkaes Exp $
+/* $Id: htmlerror.c,v 1.5 2003-05-31 23:02:21 rjkaes Exp $
*
* This file contains source code for the handling and display of
* HTML error pages with variable substitution.
@@ -64,11 +64,11 @@ static char*
get_html_file(int errornum) {
int i;
- if(!config.errorpages) return(config.errorpage_undef);
+ if (!config.errorpages) return(config.errorpage_undef);
- for(i = 0; config.errorpages[i]; i++) {
- if(config.errorpages[i]->errorpage_errnum == errornum)
- return(config.errorpages[i]->errorpage_path);
+ for (i = 0; config.errorpages[i]; i++) {
+ if (config.errorpages[i]->errorpage_errnum == errornum)
+ return config.errorpages[i]->errorpage_path;
}
return(config.errorpage_undef);
@@ -81,9 +81,9 @@ static char*
lookup_variable(struct conn_s *connptr, char *varname) {
int i;
- for(i = 0; i<connptr->error_variable_count; i++) {
- if(!strcasecmp(connptr->error_variables[i]->error_key, varname))
- return(connptr->error_variables[i]->error_val);
+ for (i = 0; i != connptr->error_variable_count; i++) {
+ if (!strcasecmp(connptr->error_variables[i]->error_key, varname))
+ return connptr->error_variables[i]->error_val;
}
return(NULL);
@@ -101,7 +101,7 @@ send_html_file(FILE *infile, struct conn_s *connptr) {
int in_variable = 0, writeret;
while(fgets(inbuf, HTML_BUFSIZE, infile) != NULL) {
- for(p = inbuf; *p; p++) {
+ for (p = inbuf; *p; p++) {
switch(*p) {
case '}':
if(in_variable) {