1*898496eeSXin LI /* $File: asctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $ */ 2b6cee71dSXin LI 3b6cee71dSXin LI #include "file.h" 4b6cee71dSXin LI #ifndef lint 5*898496eeSXin LI FILE_RCSID("@(#)$File: asctime_r.c,v 1.3 2022/09/24 20:30:13 christos Exp $") 6b6cee71dSXin LI #endif /* lint */ 7b6cee71dSXin LI #include <time.h> 8b6cee71dSXin LI #include <string.h> 9b6cee71dSXin LI 10b6cee71dSXin LI /* asctime_r is not thread-safe anyway */ 11b6cee71dSXin LI char * asctime_r(const struct tm * t,char * dst)12b6cee71dSXin LIasctime_r(const struct tm *t, char *dst) 13b6cee71dSXin LI { 14b6cee71dSXin LI char *p = asctime(t); 15b6cee71dSXin LI if (p == NULL) 16b6cee71dSXin LI return NULL; 17b6cee71dSXin LI memcpy(dst, p, 26); 18b6cee71dSXin LI return dst; 19b6cee71dSXin LI } 20