httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1491538 - /httpd/httpd/trunk/modules/generators/mod_autoindex.c
Date Mon, 10 Jun 2013 17:46:53 GMT
Author: rjung
Date: Mon Jun 10 17:46:53 2013
New Revision: 1491538

URL: http://svn.apache.org/r1491538
Log:
Reduce stack usage, 32 bytes are enough here, no need to
take 8k in the stack. (19 would be enough, but be safe...)
Use the size of the buffer as opposed to MAX_STRING_LEN.

Followup to r1491221+r1491479: change consistently
the same code used in another place in the same file.

Modified:
    httpd/httpd/trunk/modules/generators/mod_autoindex.c

Modified: httpd/httpd/trunk/modules/generators/mod_autoindex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_autoindex.c?rev=1491538&r1=1491537&r2=1491538&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_autoindex.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_autoindex.c Mon Jun 10 17:46:53 2013
@@ -1752,10 +1752,10 @@ static void output_directories(struct en
             }
             if (!(autoindex_opts & SUPPRESS_LAST_MOD)) {
                 if (ar[x]->lm != -1) {
-                    char time_str[MAX_STRING_LEN];
+                    char time_str[32];
                     apr_time_exp_t ts;
                     apr_time_exp_lt(&ts, ar[x]->lm);
-                    apr_strftime(time_str, &rv, MAX_STRING_LEN,
+                    apr_strftime(time_str, &rv, sizeof(time_str),
                                  "%Y-%m-%d %H:%M  ",
                                  &ts);
                     ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">"
: " align=\"right\">",time_str, NULL);



Mime
View raw message