--- embedaddon/php/ext/fileinfo/libmagic/print.c 2012/02/21 23:47:56 1.1.1.1 +++ embedaddon/php/ext/fileinfo/libmagic/print.c 2012/05/29 12:34:39 1.1.1.2 @@ -29,15 +29,16 @@ * print.c - debugging printout routines */ +#define _GNU_SOURCE #include "php.h" -#include "main/snprintf.h" #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: print.c,v 1.66 2009/02/03 20:27:51 christos Exp $") +FILE_RCSID("@(#)$File: print.c,v 1.71 2011/09/20 15:28:09 christos Exp $") #endif /* lint */ +#include #include #include #include @@ -85,7 +86,7 @@ file_fmttime(uint32_t v, int local) (void)time(&now); tm1 = localtime(&now); if (tm1 == NULL) - return "*Invalid time*"; + goto out; daylight = tm1->tm_isdst; } #endif /* HAVE_TM_ISDST */ @@ -94,10 +95,14 @@ file_fmttime(uint32_t v, int local) t += 3600; tm = gmtime(&t); if (tm == NULL) - return "*Invalid time*"; + goto out; pp = asctime(tm); } + if (pp == NULL) + goto out; pp[strcspn(pp, "\n")] = '\0'; return pp; +out: + return "*Invalid time*"; }