]> granicus.if.org Git - apache/commitdiff
Some changes to the ap_strftime function. We now inform the user of the
authorRyan Bloom <rbb@apache.org>
Thu, 30 Dec 1999 18:31:29 +0000 (18:31 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 30 Dec 1999 18:31:29 +0000 (18:31 +0000)
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

modules/loggers/mod_log_config.c
server/util.c

index bc436ebcd4c9b28d3c87d60f7b13552ee70a1af9..13d4a667f59fc29e6c4300d7516967c9793550e3 100644 (file)
@@ -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 ? '-' : '+');
index b63e057889bd399808f50718ba53b87a089f8cea..03ccd771b019bfceba01cff4016dc2d0acb9a15a 100644 (file)
@@ -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);
 }