xref: /freebsd/contrib/file/src/ctime_r.c (revision 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3)
1 /*	$File: ctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $	*/
2 
3 #include "file.h"
4 #ifndef	lint
5 FILE_RCSID("@(#)$File: ctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $")
6 #endif	/* lint */
7 #include <time.h>
8 #include <string.h>
9 
10 /* ctime_r is not thread-safe anyway */
11 char *
12 ctime_r(const time_t *t, char *dst)
13 {
14 	char *p = ctime(t);
15 	if (p == NULL)
16 		return NULL;
17 	memcpy(dst, p, 26);
18 	return dst;
19 }
20