diff options
Diffstat (limited to 'ctl.c')
-rw-r--r-- | ctl.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -6,21 +6,16 @@ #include "query.h" #include "site.h" -#define PFREE(s) do{ printf("%s", s); free(s); }while(0) - -char * -date(int timestamp) +void +printdate(int timestamp) { - char *buf; + char buf[20]; struct tm *t; - if(!(buf = malloc(20))) - err(1, "malloc"); - t = localtime((time_t *)×tamp); strftime(buf, 20, "%Y-%m-%d %H:%M", t); - return buf; + printf(buf); } void |