From cece2fe3c6701505110dd5a1767032e9af19d44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sun, 11 Jul 2010 17:18:54 +0000 Subject: [PATCH] mod_accesslog: Fix var declarations mixed in source (fixes #2233) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2743 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_accesslog.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6dcab62c..07530c3a 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ NEWS * mod_fastcgi: Send 502 "Bad Gateway" if we couldn't open the file for X-Sendfile (fixes #2226) * mod_staticfile: add debug output if we ignore a file with static-file.exclude-extensions (fixes #2215) * mod_cgi: fix race condition leaving response not forwarded to client (fixes #2217) + * mod_accesslog: Fix var declarations mixed in source (fixes #2233) - 1.4.26 - 2010-02-07 * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105) diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c index d78015f9..e55deca8 100644 --- a/src/mod_accesslog.c +++ b/src/mod_accesslog.c @@ -157,12 +157,14 @@ INIT_FUNC(mod_accesslog_init) { } static void accesslog_append_escaped(buffer *dest, buffer *str) { + unsigned int i; + /* replaces non-printable chars with \xHH where HH is the hex representation of the byte */ /* exceptions: " => \", \ => \\, whitespace chars => \n \t etc. */ if (str->used == 0) return; buffer_prepare_append(dest, str->used - 1); - for (unsigned int i = 0; i < str->used - 1; i++) { + for (i = 0; i < str->used - 1; i++) { if (str->ptr[i] >= ' ' && str->ptr[i] <= '~') { /* printable chars */ buffer_append_string_len(dest, &str->ptr[i], 1);