From ed491cbf6b60df0a239a5eae1f3c1bdd1dfd80fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Mon, 28 Jul 2003 13:02:37 +0000 Subject: [PATCH] cleanup current_logtime function. use sizeof where sizeof should be used. don't compute strlen again and again (use the supplied value from apr_strftime instead). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100810 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_rewrite.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 6fbff0b592..a594773798 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -372,10 +372,11 @@ static char *current_logtime(request_rec *r) apr_time_exp_lt(&t, apr_time_now()); - apr_strftime(tstr, &len, 80, "[%d/%b/%Y:%H:%M:%S ", &t); - apr_snprintf(tstr + strlen(tstr), 80-strlen(tstr), "%c%.2d%.2d]", + apr_strftime(tstr, &len, sizeof(tstr), "[%d/%b/%Y:%H:%M:%S ", &t); + apr_snprintf(tstr+len, sizeof(tstr)-len, "%c%.2d%.2d]", t.tm_gmtoff < 0 ? '-' : '+', t.tm_gmtoff / (60*60), t.tm_gmtoff % (60*60)); + return apr_pstrdup(r->pool, tstr); } -- 2.50.1