summaryrefslogtreecommitdiff
path: root/time/ctime.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/ctime.c')
-rw-r--r--time/ctime.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/time/ctime.c b/time/ctime.c
index f13d00e551..4f06f1e533 100644
--- a/time/ctime.c
+++ b/time/ctime.c
@@ -27,10 +27,7 @@
char *
ctime (const time_t *t)
{
- static char buf[64]; /* POSIX.1 suggests at least 26 bytes. */
- struct tm tm;
- struct tm *tp = __localtime_r (t, &tm);
- if (tp == NULL)
- return NULL;
- return __asctime_r (tp, buf);
+ /* The C Standard says ctime (t) is equivalent to asctime (localtime (t)).
+ In particular, ctime and asctime must yield the same pointer. */
+ return asctime (localtime (t));
}