httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: Do pools lead to bad programming?
Date Fri, 13 Dec 2013 15:14:17 GMT
On Fri, Dec 13, 2013 at 5:06 AM, Daniel Lescohier <daniel.lescohier@cbsi.com
> wrote:

> Here is my draft replacement:
>
> static const char *log_request_time_custom(request_rec *r, char *a,
>                                            apr_time_exp_t *xt)
> {
>     static const apr_size_t buf_len = 256;
>     apr_size_t tstr_len;
>     char *tstr = apr_palloc(r->pool, buf_len);
>
> 
> apr_strftime(tstr, &tstr_len, buf_len, a, xt);
>     return tstr_len ? tstr : "-";
> }
>

Shouldn't [MAX_STRING_LEN > buf_len > strlen(a)] for apr_strftime() not
to truncate the result (for any resonnable 'a')?

Mime
View raw message