diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 1999-12-30 18:31:28 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 1999-12-30 18:31:28 +0000 |
commit | bcbdd878bb4b49c6aa541e719e154883f9410ec2 (patch) | |
tree | c4f064ba2c990c9e29b481fe183575f40c6043a2 | |
parent | 78b0e65f9c522ad48fc003a04e2a749a2a3563ef (diff) | |
download | libapr-bcbdd878bb4b49c6aa541e719e154883f9410ec2.tar.gz |
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: http://svn.apache.org/repos/asf/apr/apr/trunk@59558 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/apr_time.h | 2 | ||||
-rw-r--r-- | time/unix/timestr.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/apr_time.h b/include/apr_time.h index 43e4d5be0..b17660c31 100644 --- a/include/apr_time.h +++ b/include/apr_time.h @@ -77,7 +77,7 @@ ap_status_t ap_explode_time(ap_time_t *, ap_timetype_e); ap_status_t ap_implode_time(ap_time_t *); ap_status_t ap_timestr(char **date_str, struct atime_t *t, ap_timetype_e type, ap_context_t *p); -ap_status_t ap_strftime(char *s, ap_size_t max, const char *format, ap_time_t *tm); +ap_status_t ap_strftime(char *s, ap_int32_t *retsize, ap_size_t max, const char *format, ap_time_t *tm); /* accessor functions */ ap_status_t ap_get_curtime(ap_time_t *, ap_int64_t *); diff --git a/time/unix/timestr.c b/time/unix/timestr.c index 830357560..548e9cdd9 100644 --- a/time/unix/timestr.c +++ b/time/unix/timestr.c @@ -126,8 +126,10 @@ ap_status_t ap_timestr(char **date_str, struct atime_t *t, ap_timetype_e type, a */ } -ap_status_t ap_strftime(char *s, ap_size_t max, const char *format, struct atime_t *tm) +ap_status_t ap_strftime(char *s, ap_int32_t *retsize, ap_size_t max, + const char *format, struct atime_t *tm) { - strftime(s, max, format, tm->explodedtime); + (*retsize) = strftime(s, max, format, tm->explodedtime); + return APR_SUCCESS; } |