mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
assume time_t is signed
This commit is contained in:
@@ -114,6 +114,18 @@ static inline long StringToLong(const char *magick_restrict value)
|
||||
return(strtol(value,(char **) NULL,10));
|
||||
}
|
||||
|
||||
static inline MagickOffsetType StringToMagickOffsetType(const char *string,
|
||||
const double interval)
|
||||
{
|
||||
double
|
||||
value;
|
||||
|
||||
value=SiPrefixToDoubleInterval(string,interval);
|
||||
if (value >= (double) MagickULLConstant(~0))
|
||||
return((MagickOffsetType) MagickULLConstant(~0));
|
||||
return((MagickOffsetType) value);
|
||||
}
|
||||
|
||||
static inline MagickSizeType StringToMagickSizeType(const char *string,
|
||||
const double interval)
|
||||
{
|
||||
|
||||
+2
-2
@@ -360,17 +360,17 @@ MagickExport time_t GetMagickTime(void)
|
||||
const char
|
||||
*source_date_epoch;
|
||||
|
||||
epoch_initialized=MagickTrue;
|
||||
source_date_epoch=getenv("SOURCE_DATE_EPOCH");
|
||||
if (source_date_epoch != (const char *) NULL)
|
||||
{
|
||||
time_t
|
||||
epoch;
|
||||
|
||||
epoch=(time_t) StringToUnsignedLong(source_date_epoch);
|
||||
epoch=(time_t) StringToMagickOffsetType(source_date_epoch,100.0);
|
||||
if ((epoch > 0) && (epoch <= time((time_t *) NULL)))
|
||||
magick_epoch=epoch;
|
||||
}
|
||||
epoch_initialized=MagickTrue;
|
||||
}
|
||||
if (magick_epoch != 0)
|
||||
return(magick_epoch);
|
||||
|
||||
Reference in New Issue
Block a user