scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

asctime.c (304B)


      1 #include <time.h>
      2 
      3 #undef asctime
      4 
      5 char *
      6 asctime(const struct tm *tm)
      7 {
      8 	static char buf[26];
      9 
     10 	/*
     11 	 * buf has space for a text like "Sun Sep 16 01:03:52 1973\n\0"
     12 	 * and for this reason strftime cannot fail as the buffer is
     13 	 * long enough
     14 	 */
     15 	strftime(buf, sizeof(buf), "%c\n", tm);
     16 	return buf;
     17 }