"Fossies" - the Fresh Open Source Software Archive

Member "file-5.35/src/asctime_r.c" (20 Jun 2012, 415 Bytes) of package /linux/misc/file-5.35.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "asctime_r.c" see the Fossies "Dox" file reference documentation.

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