diff options
author | delphij <delphij@FreeBSD.org> | 2014-07-11 00:00:00 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-07-11 00:00:00 +0000 |
commit | a8fc83ae7c6014d3e0809848ce57e6dbd9e6b430 (patch) | |
tree | 942bc382f7aca8fc1809046d5db53f7a55fae1f0 /contrib/file/src/asctime_r.c | |
parent | 8674b3c2aa3ad356a99168b86179e3ae4d898506 (diff) | |
download | FreeBSD-src-a8fc83ae7c6014d3e0809848ce57e6dbd9e6b430.zip FreeBSD-src-a8fc83ae7c6014d3e0809848ce57e6dbd9e6b430.tar.gz |
MFC r267897: MFV r267843:
Update file/libmagic to 5.19.
Diffstat (limited to 'contrib/file/src/asctime_r.c')
-rw-r--r-- | contrib/file/src/asctime_r.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/file/src/asctime_r.c b/contrib/file/src/asctime_r.c new file mode 100644 index 0000000..3a0ec044 --- /dev/null +++ b/contrib/file/src/asctime_r.c @@ -0,0 +1,19 @@ +/* $File: asctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $ */ + +#include "file.h" +#ifndef lint +FILE_RCSID("@(#)$File: asctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $") +#endif /* lint */ +#include <time.h> +#include <string.h> + +/* 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; +} |