From: Ryan Bloom Date: Thu, 30 Dec 1999 18:31:29 +0000 (+0000) Subject: Some changes to the ap_strftime function. We now inform the user of the X-Git-Tag: 1.3.10~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c7d0b0f433dd9117091d9f41d1fc1bff4cb58b7;p=apache Some changes to the ap_strftime function. We now inform the user of the length of the string written, and we return a status code. I expect the status code to mean a bit more on Windows than it currently does on Unix. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84376 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index bc436ebcd4..13d4a667f5 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -384,12 +384,13 @@ static const char *log_request_time(request_rec *r, char *a) ap_int32_t mday, year, hour, min, sec, month; ap_time_t *t; char tstr[MAX_STRING_LEN]; + ap_int32_t retcode; ap_make_time(&t, r->pool); ap_get_gmtoff(&timz, t, r->pool); if (a && *a) { /* Custom format */ - ap_strftime(tstr, MAX_STRING_LEN, a, t); + ap_strftime(tstr, &retcode, MAX_STRING_LEN, a, t); } else { /* CLF format */ char sign = (timz < 0 ? '-' : '+'); diff --git a/server/util.c b/server/util.c index b63e057889..03ccd771b0 100644 --- a/server/util.c +++ b/server/util.c @@ -126,6 +126,7 @@ API_EXPORT(char *) ap_field_noparam(ap_context_t *p, const char *intype) API_EXPORT(char *) ap_ht_time(ap_context_t *p, ap_time_t *t, const char *fmt, int gmt) { + ap_int32_t retcode; char ts[MAX_STRING_LEN]; char tf[MAX_STRING_LEN]; @@ -170,7 +171,7 @@ API_EXPORT(char *) ap_ht_time(ap_context_t *p, ap_time_t *t, const char *fmt, in } /* check return code? */ - ap_strftime(ts, MAX_STRING_LEN, fmt, t); + ap_strftime(ts, &retcode, MAX_STRING_LEN, fmt, t); ts[MAX_STRING_LEN - 1] = '\0'; return ap_pstrdup(p, ts); }