localtime_r.c - randomcrap - random crap programs of varying quality
 (HTM) git clone git://git.codemadness.org/randomcrap
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       localtime_r.c (228B)
       ---
            1 #include <string.h>
            2 #include <time.h>
            3 
            4 struct tm *
            5 localtime_r(const time_t *clock, struct tm *result)
            6 {
            7         struct tm *tm;
            8         
            9         if (!(tm = localtime(clock)))
           10                 return NULL;
           11         memcpy(result, tm, sizeof(struct tm));
           12 
           13         return result;
           14 }