minix/external/bsd/file/dist/src/ctime_r.c
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

26 lines
568 B
C

/* $NetBSD: ctime_r.c,v 1.1.1.3 2015/01/02 20:34:27 christos Exp $ */
/* $File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $ */
#include "file.h"
#ifndef lint
#if 0
FILE_RCSID("@(#)$File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $")
#else
__RCSID("$NetBSD: ctime_r.c,v 1.1.1.3 2015/01/02 20:34:27 christos Exp $");
#endif
#endif /* lint */
#include <time.h>
#include <string.h>
/* ctime_r is not thread-safe anyway */
char *
ctime_r(const time_t *t, char *dst)
{
char *p = ctime(t);
if (p == NULL)
return NULL;
memcpy(dst, p, 26);
return dst;
}