From 1ebbd027274333758fc3517685d81847601db676 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:00:10 +0200 Subject: Adding upstream version 1:5.45. Signed-off-by: Daniel Baumann --- src/asctime_r.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/asctime_r.c (limited to 'src/asctime_r.c') diff --git a/src/asctime_r.c b/src/asctime_r.c new file mode 100644 index 0000000..c76ca69 --- /dev/null +++ b/src/asctime_r.c @@ -0,0 +1,19 @@ +/* $File: asctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $ */ + +#include "file.h" +#ifndef lint +FILE_RCSID("@(#)$File: asctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $") +#endif /* lint */ +#include +#include + +/* asctime_r is not thread-safe anyway */ +char * +asctime_r(const struct tm *t, char *dst) +{ + char *p = asctime(t); + if (p == NULL) + return NULL; + memcpy(dst, p, 26); + return dst; +} -- cgit v1.2.3