Skip to content

Commit aecf7ab

Browse files
author
Cristy
committed
improve time-to-live formatting
1 parent 7d49c7d commit aecf7ab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

MagickCache/magick-cache.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -1770,10 +1770,12 @@ MagickExport MagickBooleanType IdentifyMagickCacheResource(MagickCache *cache,
17701770
expired=' ';
17711771
if ((resource->ttl != 0) && ((resource->timestamp+resource->ttl) < time(0)))
17721772
expired='*';
1773-
(void) fprintf(file,"%s%s %s %g:%g:%g:%g%c %s\n",GetMagickCacheResourceIRI(
1774-
resource),size,extent,(double) (resource->ttl/(3600*24)),(double)
1775-
((resource->ttl % (24*3600))/3600),(double) ((resource->ttl % 3600)/60),
1776-
(double) ((resource->ttl % 3600) % 60),expired,iso8601);
1773+
(void) fprintf(file,"%s%s %s %g:%02g:%02g:%02g%c %s\n",
1774+
GetMagickCacheResourceIRI(resource),size,extent,
1775+
ceil((double) (resource->ttl/(3600*24))),
1776+
ceil((double) ((resource->ttl % (24*3600))/3600)),
1777+
ceil((double) ((resource->ttl % 3600)/60)),
1778+
ceil((double) ((resource->ttl % 3600) % 60)),expired,iso8601);
17771779
path=DestroyString(path);
17781780
return(status);
17791781
}

0 commit comments

Comments
 (0)