From: Christos Zoulas Date: Wed, 18 Nov 2009 23:35:14 +0000 (+0000) Subject: fix for broken ctime/asctime. X-Git-Tag: FILE5_04~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e9de40741c92b0743a90de61767df0fae2eceb8;p=file fix for broken ctime/asctime. --- diff --git a/ChangeLog b/ChangeLog index c0d5b807..44ce2bc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-17 18:35 Christos Zoulas @@ -218,7 +218,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 */ @@ -227,10 +227,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*"; }