xref: /netbsd-src/external/bsd/file/dist/src/ctime_r.c (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*	$NetBSD: ctime_r.c,v 1.1.1.2 2014/06/13 01:48:21 christos Exp $	*/
2 /*	$File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $	*/
3 
4 #include "file.h"
5 #ifndef	lint
6 #if 0
7 FILE_RCSID("@(#)$File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $")
8 #else
9 __RCSID("$NetBSD: ctime_r.c,v 1.1.1.2 2014/06/13 01:48:21 christos Exp $");
10 #endif
11 #endif	/* lint */
12 #include <time.h>
13 #include <string.h>
14 
15 /* ctime_r is not thread-safe anyway */
16 char *
17 ctime_r(const time_t *t, char *dst)
18 {
19 	char *p = ctime(t);
20 	if (p == NULL)
21 		return NULL;
22 	memcpy(dst, p, 26);
23 	return dst;
24 }
25